JP2007312340A - Dynamic image encoding device - Google Patents

Dynamic image encoding device Download PDF

Info

Publication number
JP2007312340A
JP2007312340A JP2006144890A JP2006144890A JP2007312340A JP 2007312340 A JP2007312340 A JP 2007312340A JP 2006144890 A JP2006144890 A JP 2006144890A JP 2006144890 A JP2006144890 A JP 2006144890A JP 2007312340 A JP2007312340 A JP 2007312340A
Authority
JP
Japan
Prior art keywords
macroblock
rows
encoding
row
pair
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
JP2006144890A
Other languages
Japanese (ja)
Other versions
JP4062711B2 (en
Inventor
Toshihiro Minami
俊宏 南
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.)
Minami Toshihiro
Original Assignee
Minami Toshihiro
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 Minami Toshihiro filed Critical Minami Toshihiro
Priority to JP2006144890A priority Critical patent/JP4062711B2/en
Priority to PCT/JP2007/000292 priority patent/WO2007129433A1/en
Publication of JP2007312340A publication Critical patent/JP2007312340A/en
Application granted granted Critical
Publication of JP4062711B2 publication Critical patent/JP4062711B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/523Motion estimation or motion compensation with sub-pixel accuracy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/43Hardware specially adapted for motion estimation or compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a dynamic image encoding device of a macro block pipeline structure wherein a processing result of an adjacent block is reflected in the process of the block being encoded. <P>SOLUTION: At least two rows of macro blocks continuous in the longitudinal direction are united into one set. One macro block is selected from each one row of macro blocks from the set of the macro block rows. The selected macro blocks are input into a macro block pipeline for each one macro block cycle and encoding of the macro blocks is started. For example, macro blocks of row-e column-10, row-f column-8, row-g column-6, row-h column-4 are input into the macro block pipeline for each macro block cycle and encoding is started. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、動画像のデータ量を圧縮・削減するための動画像符号化装置、動画像符号化方法、および固定長符号を可変長符号に変換する算術符号化装置に関するものである。   The present invention relates to a moving picture coding apparatus, a moving picture coding method, and an arithmetic coding apparatus for converting a fixed length code into a variable length code for compressing and reducing the data amount of the moving picture.

動画像には、720Pのようにフレームで構成されるものと、1080iのようにフィールドで構成されるものがあるが、本発明はフレームで構成されるものに適用してもフィールドで構成されるものに適用してもその目的を達成でき、同様の作用・効果を生じる。そこで、以下では、動画像を構成する1枚の画像を示すためにピクチャという用語を用いる。ピクチャはフレームとフィールドの両方を表すものとする。   Some moving images are composed of frames such as 720P and others are composed of fields such as 1080i, but the present invention is composed of fields even when applied to those composed of frames. Even if it is applied to things, the purpose can be achieved, and similar actions and effects are produced. Therefore, in the following, the term “picture” is used to indicate one image constituting a moving image. A picture shall represent both a frame and a field.

MPEG−2やH.264(MPEG−4 AVCとも呼ばれる)、VC−1等の動画像符号化方式では、画面を16画素×16画素や8画素×8画素等のマクロブロック(以下、MBという。)に分割し、MB単位で動き検出、動き補償、DCTまたは整数変換等の周波数変換、量子化、可変長符号化等を行う。これらの動画像符号化方式では、符号化効率を向上させるために、符号化済みの周辺MBの結果をフィードバックし、符号化中のMB(以下、現MBという。)の処理内容を決める適応処理が行われる。   MPEG-2 and H.264 In a moving image coding system such as H.264 (also referred to as MPEG-4 AVC) or VC-1, the screen is divided into macroblocks (hereinafter referred to as MB) of 16 pixels × 16 pixels or 8 pixels × 8 pixels. Motion detection, motion compensation, frequency conversion such as DCT or integer conversion, quantization, variable length coding, and the like are performed in MB units. In these moving image encoding systems, in order to improve the encoding efficiency, the result of the encoded peripheral MB is fed back, and adaptive processing for determining the processing content of the MB being encoded (hereinafter referred to as the current MB). Is done.

図46はMPEG−2の符号化器のブロック図を示す。MPEG−2では発生符号量が局所的に変動することを防ぐために、個々のMBの量子化パラメータを変更することによって発生符号量を制御する。これをレート制御92という。レート制御92では、可変長符号化91の結果発生した符号化済みMBの符号量に応じて現MBの量子化パラメータを変更する。例えば、左隣接MBの発生符号量が大きい場合、現MBの量子化パラメータを大きくし、現MBの発生符号量を減少させる。   FIG. 46 shows a block diagram of an MPEG-2 encoder. In MPEG-2, in order to prevent the generated code amount from fluctuating locally, the generated code amount is controlled by changing the quantization parameter of each MB. This is called rate control 92. In the rate control 92, the quantization parameter of the current MB is changed according to the code amount of the encoded MB generated as a result of the variable length encoding 91. For example, when the generated code amount of the left adjacent MB is large, the quantization parameter of the current MB is increased and the generated code amount of the current MB is decreased.

図47はH.264の符号化器のブロック図を示す。H.264はMPEG−2に比べて2倍程度の効率で動画像を圧縮できる。この高い圧縮効率を実現するために、H.264では、動き補償100における参照ピクチャ数の増加、可変ブロックサイズ動き補償や4画素×4画素単位の周波数変換(以下、整数変換93という。)が採用されると共に、レート制御103に加えて以下の3つの適応処理が新たに導入された。ここで、可変ブロックサイズ動き補償とは、MBを8画素×16画素、8画素×8画素、4画素×4画素等のサブブロック(以下、SBという。)に分割し、SBごとに動き補償を行うことをいう。以下では、単にブロックというときには、MBとSBの両方を意味するものとする。   FIG. 2 shows a block diagram of an H.264 encoder. H. H.264 can compress moving images with twice the efficiency of MPEG-2. In order to achieve this high compression efficiency, H.264 employs an increase in the number of reference pictures in motion compensation 100, variable block size motion compensation, and frequency conversion in units of 4 pixels × 4 pixels (hereinafter referred to as integer conversion 93), and in addition to rate control 103, The three adaptive processes are newly introduced. Here, variable block size motion compensation means that MB is divided into sub-blocks (hereinafter referred to as SB) such as 8 pixels × 16 pixels, 8 pixels × 8 pixels, 4 pixels × 4 pixels, etc., and motion compensation is performed for each SB. To do. Hereinafter, when simply referring to a block, both MB and SB are meant.

(1)予測誤差の符号量だけではなく、参照ピクチャの符号量と動きベクトルの符号量を考慮し、それらの合計符号量が最小となる参照ピクチャ、動きベクトル、およびブロックの組み合わせを選択する。動きベクトルについては、左隣接ブロック、上隣接ブロック、および右上隣接ブロックの動きベクトルから予測される予測動きベクトル(以下、PMVという。)を求め、PMVと現ブロックの動きベクトルの差分を符号化する。また、左隣接ブロック、上隣接ブロック、および右上隣接ブロックの動きベクトルは、空間ダイレクトモードの動きベクトルを求めるときにも参照される。 (1) Considering not only the code amount of a prediction error but also the code amount of a reference picture and the code amount of a motion vector, a combination of a reference picture, a motion vector, and a block that minimizes the total code amount thereof is selected. For the motion vector, a predicted motion vector (hereinafter referred to as PMV) predicted from the motion vectors of the left adjacent block, the upper adjacent block, and the upper right adjacent block is obtained, and the difference between the motion vector of the PMV and the current block is encoded. . In addition, the motion vectors of the left adjacent block, the upper adjacent block, and the upper right adjacent block are also referred to when obtaining the motion vector in the spatial direct mode.

(2)隣接MBの再生画素から予測値を作成し、イントラ予測97を行う。輝度信号については4画素×4画素SB(以下、4×4SBという。)のイントラ予測モードと16×16画素ブロックのイントラ予測モードがある。輝度信号の4×4SBのイントラ予測モードでは、左隣接4×4SB、上隣接4×4SB、および右上隣接4×4SBの再生画素から現4×4SBのイントラ予測値を作成し、このイントラ予測値と現4×4SBの画素の差分を符号化する。この差分画素を整数変換・量子化・逆量子化・逆整数変換し、その結果にイントラ予測値を加算することにより再生画素が作成される。16×16画素ブロックのイントラ予測モードでは左隣接MBと上隣接MBの再生画素から現16×16画素ブロックのイントラ予測値を作成し、このイントラ予測値と現16×16画素ブロックの画素の差分を符号化する。 (2) A prediction value is created from the reproduced pixels of the adjacent MB, and intra prediction 97 is performed. As for the luminance signal, there are an intra prediction mode of 4 pixels × 4 pixels SB (hereinafter referred to as 4 × 4 SB) and an intra prediction mode of 16 × 16 pixel blocks. In the 4 × 4SB intra prediction mode of the luminance signal, an intra prediction value of the current 4 × 4SB is generated from the reproduction pixels of the left adjacent 4 × 4SB, the upper adjacent 4 × 4SB, and the upper right adjacent 4 × 4SB, and this intra predicted value And the difference between the current 4 × 4 SB pixels. The difference pixel is subjected to integer transformation / quantization / inverse quantization / inverse integer transformation, and an intra prediction value is added to the result, thereby generating a reproduction pixel. In the 16 × 16 pixel block intra prediction mode, an intra prediction value of the current 16 × 16 pixel block is created from the reproduction pixels of the left adjacent MB and the upper adjacent MB, and the difference between the intra prediction value and the pixel of the current 16 × 16 pixel block is created. Is encoded.

(3)4画素×4画素ブロックの境界にデブロッキングフィルタ98をかけ、ブロックノイズを除去する。 (3) A deblocking filter 98 is applied to the boundary of the 4 pixel × 4 pixel block to remove block noise.

一方、ハードウェアの動画像符号化装置では、回路の稼働率を上げるためにMB単位のパイプライン(本特許請求の範囲および明細書では、マクロブロックパイプラインまたはMBパイプラインという。)が採用されるのが一般的である(例えば、非特許文献1のpp.126-128、図3参照)。また、ハードウェアの動画像符号化装置では、通常横方向のMBの並び(以下MB行という)内では左端MBから右端MBに向かって符号化される。そして、1つのMB行に含まれる右端のMBの符号化が終了すると、次にその下のMB行に属するMBが左端MBから右端MBに向かって符号化される。これがピクチャの最も上のMB行からピクチャの最も下のMB行まで繰り返される。図48は、従来のH.264の符号化器のMBパイプラインにおいて、MBがMBパイプラインの各ステージを流れていく様子を示したものである。n−1、n、およびn+1はあるMB行中の左からそれぞれn−1番目、n番目、n+1番目のMBを表す。また、MBサイクルとは、MBパイプラインの各ステージで1個のMBが処理されるために要する時間の単位をいい、各ステージでは1MBサイクルで1個のMBが処理される。   On the other hand, a hardware moving image encoding apparatus employs a pipeline in MB units (referred to as a macroblock pipeline or an MB pipeline in the claims and the specification) in order to increase the operation rate of a circuit. (For example, see Non-Patent Document 1, pp. 126-128, FIG. 3). Further, in a hardware moving image encoding apparatus, encoding is generally performed from the left end MB toward the right end MB in a horizontal MB array (hereinafter referred to as MB row). When the encoding of the rightmost MB included in one MB row is completed, the MBs belonging to the lower MB row are encoded from the left end MB toward the right end MB. This is repeated from the top MB row of the picture to the bottom MB row of the picture. FIG. In the MB pipeline of the H.264 encoder, the manner in which the MB flows through each stage of the MB pipeline is shown. n-1, n, and n + 1 represent the (n-1) th, nth, and n + 1th MBs from the left in a certain MB row, respectively. The MB cycle is a unit of time required for processing one MB in each stage of the MB pipeline. In each stage, one MB is processed in one MB cycle.

図48では、ステージ0で1MBサイクルかけて外部メモリから1個のMBの符号化に必要なデータを読み出す。ステージ1で1MBサイクルかけて1個のMBについて粗い精度の動き検出を行う。ステージ2で1MBサイクルかけてステージ1で検出された粗い精度の候補動きベクトルの周囲の狭い範囲で詳細な動き検出を行うと共に、イントラ予測を行う。ステージ3では1MBサイクルかけて1個のMBについて整数変換、量子化、逆量子化、および逆整数変換を行う。ステージ4では1MBサイクルかけて1個のMBについて可変長符号化と動き補償を行う。そして、ステージ5で1MBサイクルかけて1個のMBについてレート制御とデブロッキングフィルタを行い、ステージ6で1MBサイクルかけて1個のMB分の再生画素やビットストリームを外部メモリに書き込む。MBサイクルを1000サイクルと仮定すると、MBパイプラインを行わない場合には1個のMBの符号化処理に7000サイクルかかるのに対し、図48のMBパイプラインでは1000サイクルごとに1つのMBの符号化が終了する。   In FIG. 48, data necessary for encoding one MB is read out from the external memory over 1 MB cycle in stage 0. Stage 1 performs coarse motion detection for one MB over 1 MB cycle. Detailed motion detection is performed in a narrow range around the coarse motion candidate motion vector detected in stage 1 over 1 MB cycle in stage 2 and intra prediction is performed. In stage 3, integer conversion, quantization, inverse quantization, and inverse integer conversion are performed on one MB over 1 MB cycle. In stage 4, variable length coding and motion compensation are performed for one MB over one MB cycle. Then, stage 1 performs rate control and deblocking filtering on one MB over 1 MB cycle, and stage 6 writes a reproduction pixel or bit stream for one MB over 1 MB cycle to the external memory. Assuming that the MB cycle is 1000 cycles, the encoding process of one MB takes 7000 cycles when the MB pipeline is not performed, whereas the MB pipeline in FIG. 48 has one MB code every 1000 cycles. The conversion ends.

しかし、このMBパイプラインで左隣接MBの処理結果に応じた適応処理を行うためには、以下の4点の課題がある。   However, in order to perform adaptive processing according to the processing result of the left adjacent MB in this MB pipeline, there are the following four problems.

(1)図48に示すように、n−1番目のMBについてレート制御が終了したとき、既にn+1番目のMBまで量子化が終了している。従って、n−1番目のMBの発生符号量に応じて量子化パラメータを変更できるのは、n+2番目以降のMBである。すなわち、2MB分レート制御が遅れる。 (1) As shown in FIG. 48, when the rate control is finished for the (n-1) th MB, the quantization has already been finished up to the (n + 1) th MB. Therefore, the quantization parameter can be changed according to the generated code amount of the (n−1) th MB for the (n + 2) th and subsequent MBs. That is, 2 MB rate control is delayed.

(2)図48では動き検出をMBパイプライン2段で実行し、ステージ2で高精度の動きベクトル検出と同時にイントラ予測を実行している。高精度の動きベクトルが決定し、かつイントラ予測かインター予測かが決まらなければ正確なPMVは算出できないが、n−1番目のMBについて高精度の動きベクトルとイントラ予測かインター予測かが決まったときにはn番目のMBについてステージ1における粗い精度の動きベクトル検出は終了している。このため、図48のMBパイプラインでは、左隣接MBについては荒い精度の動きベクトル検出結果しか考慮して動きベクトルを選択することはできず、左隣接MBにおける高精度の動きベクトルおよびイントラ予測/インター予測判定結果を考慮して動きベクトルを選択することができない。加えて、H.264ではMBを分割した8画素×16画素、8画素×8画素、4画素×4画素等のSBでも動きベクトルの符号量を考慮して動きベクトル検出を行うことが望ましいが、図48のMBパイプラインでは左隣接SB、上隣接SB、および右上隣接SBの動きベクトルの符号量を考慮して動きベクトル検出を行うことは困難である。 (2) In FIG. 48, motion detection is executed in two stages of the MB pipeline, and intra prediction is executed simultaneously with high-precision motion vector detection in stage 2. An accurate PMV cannot be calculated unless a high-precision motion vector is determined and intra prediction or inter prediction is determined, but a high-precision motion vector and intra prediction or inter prediction are determined for the (n-1) th MB. Sometimes the motion vector detection with coarse accuracy in the stage 1 is finished for the nth MB. For this reason, in the MB pipeline of FIG. 48, a motion vector cannot be selected considering only a rough accuracy motion vector detection result for the left adjacent MB, and a highly accurate motion vector and intra prediction / A motion vector cannot be selected in consideration of the inter prediction determination result. In addition, H.C. In H.264, it is desirable to perform motion vector detection in consideration of the code amount of the motion vector even in the SB of 8 pixels × 16 pixels, 8 pixels × 8 pixels, 4 pixels × 4 pixels, and the like obtained by dividing the MB. In a pipeline, it is difficult to perform motion vector detection in consideration of the code amounts of the motion vectors of the left adjacent SB, the upper adjacent SB, and the upper right adjacent SB.

(3)16画素×16画素ブロックイントラ予測モードは、左隣接16画素×16画素ブロックと上隣接16画素×16画素ブロックの画素値と現ブロックの画素値を評価して決定される。ここで、評価に使用する隣接16画素×16画素ブロックの画素は再生画素であることが望ましい。再生画素は、イントラ予測やインター予測で得られた予測誤差を整数変換、量子化、逆量子化および逆整数変換し、予測値を加算することにより求められる。しかし、図48のMBパイプラインではステージ3でn−1番目のMBの整数変換等が終わり、ステージ4の動き補償でn−1番目のMBの再生画素が作成されたときには、ステージ2におけるn番目のMBのイントラ予測は終了している。このため、n番目のMBについて16画素×16画素ブロックイントラ予測の予測モード判定を行うときには、その左に隣接したn−1番目のMBの再生画素を使用することはできない。このため、左に隣接したn−1番目の16画素×16画素ブロックの予測モード判定については再生画素ではなく、符号化中の現ピクチャの画素を使用せざるを得ない。同様に、H.264における4画素×4画素ブロックイントラ予測モードでは左隣接、上隣接、右上隣接の4画素×4画素ブロックの再生画素を使用して予測モードを決定することが望ましいが、図48のMBパイプラインでは不可能であり、次善の手段として符号化中の現ピクチャの画素を使用せざるを得ない。このため、図48のMBパイプラインにより決定されるイントラ予測モードは準最適なものとなる。 (3) The 16 pixel × 16 pixel block intra prediction mode is determined by evaluating the pixel value of the left adjacent 16 pixel × 16 pixel block and the upper adjacent 16 pixel × 16 pixel block and the pixel value of the current block. Here, it is desirable that the pixels of the adjacent 16 pixel × 16 pixel block used for evaluation are reproduction pixels. The reproduced pixel is obtained by performing integer conversion, quantization, inverse quantization, and inverse integer conversion on a prediction error obtained by intra prediction or inter prediction, and adding a prediction value. However, in the MB pipeline of FIG. 48, when the integer conversion of the (n−1) th MB is completed in stage 3 and the reproduction pixel of the (n−1) th MB is created by the motion compensation in stage 4, the n in the stage 2 The intra prediction of the second MB has been completed. For this reason, when the prediction mode determination of 16 pixel × 16 pixel block intra prediction is performed for the nth MB, the reproduction pixel of the (n−1) th MB adjacent to the left cannot be used. For this reason, in the prediction mode determination of the (n−1) th 16-pixel × 16-pixel block adjacent to the left, the pixel of the current picture being encoded must be used instead of the reproduction pixel. Similarly, H.M. In the 4 pixel × 4 pixel block intra prediction mode in H.264, it is desirable to determine the prediction mode using the reproduction pixels of the 4 pixels × 4 pixel block of the left adjacent, upper adjacent, and upper right adjacent, but the MB pipeline of FIG. In this case, it is impossible to use the pixels of the current picture being encoded as a suboptimal measure. For this reason, the intra prediction mode determined by the MB pipeline in FIG. 48 is suboptimal.

(4)イントラ予測値は、符号化装置と復号装置で同一のものを使用しなければならないため、再生画素から作成せざるを得ない。一方、PピクチャとBピクチャでは、左に隣接したn−1番目のMBがインター予測モードと判定された場合には、動き補償が終わるまで再生画素が得られない。しかし、図48のMBパイプラインでは、n−1番目のMBについてのステージ4における再生画素の生成と、n番目のMBについてのステージ3における整数変換等は同時に実行される。このため、PピクチャとBピクチャでは、n−1番目のMBの再生画素を用いて予測値を作成し、n番目のMBの整数変換等を行うことは困難である。 (4) Since the same intra prediction value must be used in the encoding device and the decoding device, it must be generated from the reproduced pixels. On the other hand, in the P picture and the B picture, when the n−1th MB adjacent to the left is determined to be in the inter prediction mode, a reproduced pixel cannot be obtained until the motion compensation is completed. However, in the MB pipeline of FIG. 48, the generation of the reproduction pixel in the stage 4 for the (n-1) th MB, the integer conversion in the stage 3 for the nth MB, and the like are executed simultaneously. For this reason, in the P picture and the B picture, it is difficult to create a prediction value using the reproduction pixel of the (n-1) th MB and perform integer conversion of the nth MB.

また、ピクチャのデータ量は膨大であるため、一般にピクチャは動画像符号化装置の外部のメモリに記憶される。図49は、従来の動きベクトル検出器106の構成を示すブロック図である(例えば、非特許文献2のp2009、図3参照)。内部メモリ104と動き検出回路105で構成される。従来の動きベクトル検出器106では動きベクトルが存在する可能性がある領域(以下、参照領域という。)を動きベクトル検出器106の外部メモリ4から動きベクトル検出器106の内部メモリ104にコピーし、内部メモリ104内の画素に対して動きベクトルを検出するための演算が行われる。図50は、隣接する2つのMB107、108の参照領域109、110の例を示す。MB108の参照領域110はMB107の参照領域109と大部分重なっており、重なっていない領域の幅はMBの横方向の画素数と一致する。参照領域110は参照領域109より右方向にMBの横方向の画素数分ずれているだけである。以下では、このずれている領域を更新領域111と呼ぶ。従来の動きベクトル検出器106はこの性質を利用して外部メモリ4と動きベクトル検出器106の内部メモリ104間の画素転送量を削減する。外部メモリ4から内部メモリ104へは更新領域111のみ転送し、MB108の動き検出を開始するとき、参照領域の原点を参照領域109の(0,0)から参照領域110の(0,0)’に付け替える。このように、更新領域111のみ読み込んで参照領域を更新することにより外部メモリ4から内部メモリ104への転送量を削減していた。すなわち、従来は参照領域の横方向の重なりを利用して外部メモリ4と内部メモリ104の間の画素転送量を削減していた。これにより、従来の1チップMPEG−2コーデックLSIは、200MHzで動作する32ビット幅のDDR−SDRAMを2個外付けすることで1080iの動画像を符号化することが可能となった(例えば、非特許文献4のpp.12-13参照)。   Also, since the amount of picture data is enormous, the picture is generally stored in a memory external to the moving picture coding apparatus. FIG. 49 is a block diagram showing a configuration of a conventional motion vector detector 106 (see, for example, p2009 of Non-Patent Document 2 and FIG. 3). An internal memory 104 and a motion detection circuit 105 are included. In the conventional motion vector detector 106, a region where a motion vector may exist (hereinafter referred to as a reference region) is copied from the external memory 4 of the motion vector detector 106 to the internal memory 104 of the motion vector detector 106, An operation for detecting a motion vector is performed on the pixels in the internal memory 104. FIG. 50 shows an example of reference areas 109 and 110 of two adjacent MBs 107 and 108. The reference area 110 of the MB 108 substantially overlaps the reference area 109 of the MB 107, and the width of the non-overlapping area matches the number of pixels in the horizontal direction of the MB. The reference area 110 is only shifted from the reference area 109 to the right by the number of pixels in the horizontal direction of MB. Hereinafter, this shifted area is referred to as an update area 111. The conventional motion vector detector 106 uses this property to reduce the pixel transfer amount between the external memory 4 and the internal memory 104 of the motion vector detector 106. When only the update area 111 is transferred from the external memory 4 to the internal memory 104 and motion detection of the MB 108 is started, the origin of the reference area is changed from (0, 0) of the reference area 109 to (0, 0) ′ of the reference area 110. Replace with. As described above, the transfer amount from the external memory 4 to the internal memory 104 is reduced by reading only the update area 111 and updating the reference area. That is, conventionally, the amount of pixel transfer between the external memory 4 and the internal memory 104 has been reduced by utilizing the horizontal overlap of the reference areas. As a result, the conventional one-chip MPEG-2 codec LSI can encode a 1080i moving image by attaching two 32-bit DDR-SDRAMs operating at 200 MHz (for example, (See Non-Patent Document 4, pp. 12-13).

しかし、DCI(Digital Cinema Initiative)の定めたデジタルシネマ規格による1ピクチャの大きさは4096画素×2160画素であり、1080i(1920画素×1080画素)の4倍の画素数を有する。また、1080iの3倍を超える画素数のピクチャを1080iの2倍のレート(60枚/秒)で出力するCMOSセンサが開発されている(例えば、非特許文献3のsesion 27.1参照)。最新の技術を用いれば、デジタルシネマクラスの動画像を出力するビデオカメラも実現できると予測されるところ、従来の技術を用いたのでは動画像符号化LSIに256ビット幅の入力端子を設けるか、または外部メモリを800MHz程度の速度で動作させることが必要となるという問題がある。   However, the size of one picture according to the digital cinema standard defined by DCI (Digital Cinema Initiative) is 4096 pixels × 2160 pixels, which is four times as many as 1080i (1920 pixels × 1080 pixels). In addition, a CMOS sensor that outputs a picture having a number of pixels exceeding three times that of 1080i at a rate twice as high as that of 1080i (60 pictures / second) has been developed (see, for example, section 27.1 of Non-Patent Document 3). If the latest technology is used, it is predicted that a video camera that outputs a moving image of a digital cinema class can be realized. If the conventional technology is used, is a moving image encoding LSI provided with a 256-bit width input terminal? There is a problem that it is necessary to operate the external memory at a speed of about 800 MHz.

また、動画像符号化装置の処理速度が遅く、1台では処理が間に合わない場合、複数の動画像符号化装置による並列処理が行われる。この場合のピクチャ分割方法として、図51に示す4種類が考えられる(例えば、非特許文献5のp.17、Figure
1参照)。すなわち、(a)横分割、(b)縦分割、(c)縦横分割、(d)スライスインタリーブである。従来は、複数の画像符号化装置間の接続やデータ転送が簡単になるという理由で(a)横分割が採用されることが多かった(例えば、非特許文献4参照)。しかし、横分割し、複数の動画像符号化装置で並列処理する方法では、カメラから1ピクチャ分の画素が全て読み込まれるまで符号化開始が遅延するという問題がある。この遅延が生じることは、テレビ電話や遠隔監視等の低遅延を要求される通信アプリケーションでは望ましくない。
In addition, when the processing speed of the video encoding device is slow and the processing cannot be performed in time with one unit, parallel processing by a plurality of video encoding devices is performed. As the picture dividing method in this case, four types shown in FIG. 51 can be considered (for example, p.17 of Non-Patent Document 5, FIG.
1). That is, (a) horizontal division, (b) vertical division, (c) vertical and horizontal division, and (d) slice interleaving. Conventionally, (a) horizontal division has often been adopted because connection between a plurality of image encoding devices and data transfer are simplified (for example, see Non-Patent Document 4). However, the method of performing horizontal division and performing parallel processing with a plurality of moving image encoding apparatuses has a problem that the start of encoding is delayed until all pixels for one picture are read from the camera. The occurrence of this delay is undesirable in communication applications that require low delay such as videophones and remote monitoring.

また、H.264では可変長符号化を算術符号化の一種であるCABACで行うことができる。図52は、CABAC符号化器のブロック図を示す。CABACでは、まず、多値のシンタックスデータ(H.264ではシンタックスエレメントと呼ばれるが、本明細書と特許請求の範囲では、シンタックスデータという。)を2値化回路112により可変長の2値化シンボルに変換する。次に、コンテクスト計算回路113により2値化シンボル1
ビット(以下、symbolという。)ごとにコンテキスト計算を行う。そして、計算されたコンテキスト情報に応じて、算術符号化の確率テーブル115を選択し、算術符号化回路114によりsymbolを算術符号化するとともに、確率テーブル115の更新を行い、次のsymbolの算術符号化には更新された確率テーブル115を用いる。
H. In H.264, variable length coding can be performed by CABAC, which is a kind of arithmetic coding. FIG. 52 shows a block diagram of a CABAC encoder. In CABAC, first, multi-value syntax data (referred to as syntax data in H.264 but referred to as syntax data in this specification and claims) is converted to variable length 2 by a binarization circuit 112. Convert to a valued symbol. Next, the context calculation circuit 113 performs binarization symbol 1
Context calculation is performed for each bit (hereinafter referred to as symbol). Then, the arithmetic coding probability table 115 is selected according to the calculated context information, the symbol is arithmetically encoded by the arithmetic encoding circuit 114, the probability table 115 is updated, and the arithmetic symbol of the next symbol is calculated. The updated probability table 115 is used for conversion.

図53は、算術符号化回路114の処理内容を表すBiari_encode_symbol処理フローである(例えば、非特許文献7参照)。CABACでは、符号化の状態をsymbol系列の存在区間の幅(以下、rangeという。)と下端(以下、lowという)で表す。rangeとlowのビット幅はそれぞれ9ビットと10ビットであり、スライスの先頭でrangeは0x1FE(0xは、16進数であることを示す。以下、同じ)、lowは0x000に初期化される。0と1のうち、発生確率の低い方がLPS(Least Probable Symbol)に割り当てられ、発生確率の高い方がMPS(Most Probable Symbol)に割り当てられる。確率テーブル115は、コンテクスト情報ごとにsymbolの発生確率を保持している。各発生確率は0または1のいずれがMPSに割り当てられているかという情報とLPSの発生確率(以下、rLPSという。)の状態を示す番号(以下、stateという。)で示され、rLPSは、stateとrangeによってテーブル(rLPS_table_64x4)を引くことにより求められる(ステップS30)。一方、MPSの発生確率は、rangeからrLPSを減算することで算出される(ステップS31)。   FIG. 53 is a Biari_encode_symbol processing flow showing the processing contents of the arithmetic encoding circuit 114 (see, for example, Non-Patent Document 7). In CABAC, the coding state is represented by the width (hereinafter referred to as “range”) and the lower end (hereinafter referred to as “low”) of the existence sequence of the symbol sequence. The bit widths of range and low are 9 bits and 10 bits, respectively, and at the head of the slice, range is initialized to 0x1FE (0x indicates a hexadecimal number, hereinafter the same), and low is initialized to 0x000. Of 0 and 1, the lower occurrence probability is assigned to LPS (Least Probable Symbol), and the higher occurrence probability is assigned to MPS (Most Probable Symbol). The probability table 115 holds the occurrence probability of symbol for each context information. Each occurrence probability is indicated by information indicating whether 0 or 1 is assigned to the MPS and a number (hereinafter referred to as “state”) indicating an LPS occurrence probability (hereinafter referred to as “rLPS”). And range are used to obtain a table (rLPS_table_64x4) (step S30). On the other hand, the occurrence probability of MPS is calculated by subtracting rLPS from range (step S31).

symbolがLPSであるときのrangeとlowの変化を図54(a)に示す。symbolがLPSであるとき、MPSの発生確率を加算することによってlowが更新され、rangeにはrLPSが設定される(ステップS33)。state=0であれば、次の符号化状態における0と1の発生確率の大小が逆転すると予想されるため、MPSに対応する0と1が入れ替えられる(ステップS34、S35)。そして、LPSに対応する遷移テーブル(AC_next_state_LPS_64)を引くことによって、stateの状態が更新される(ステップS36)。   FIG. 54A shows changes in range and low when symbol is LPS. When symbol is LPS, low is updated by adding the occurrence probability of MPS, and rLPS is set in range (step S33). If state = 0, the occurrence probability of 0 and 1 in the next coding state is expected to be reversed, so 0 and 1 corresponding to MPS are switched (steps S34 and S35). Then, the state of the state is updated by drawing the transition table (AC_next_state_LPS_64) corresponding to the LPS (step S36).

symbolがMPSであるときのrangeとlowの変化を図54(b)に示す。symbolがMPSであるとき、lowは変化せず、rangeにはMPSの発生確率が設定される(ステップS31)。そして、MPSに対応する遷移テーブル(AC_next_state_MPS_64)を引くことによって、stateの状態が更新される(ステップS37)。   FIG. 54B shows changes in range and low when symbol is MPS. When symbol is MPS, low does not change, and MPS occurrence probability is set in range (step S31). Then, the state of the state is updated by drawing the transition table (AC_next_state_MPS_64) corresponding to the MPS (step S37).

range<0x100のときには、再正規化が行われ、rangeとlowが拡大される(ステップS38)。再正規化により、rangeの範囲は、0x100≦range≦0x1FEとなる。   When range <0x100, renormalization is performed, and range and low are expanded (step S38). Due to renormalization, the range of range becomes 0x100 ≦ range ≦ 0x1FE.

このように、symbolごとに算術符号化せざるを得えず、処理サイクル数がかかるにもかかわらず、1つのスライス内では1個の確率テーブル115しか使用できない。このため、算術符号化器114は原理的に並列化できない。   In this way, arithmetic coding must be performed for each symbol, and only one probability table 115 can be used in one slice despite the number of processing cycles. For this reason, the arithmetic encoder 114 cannot be parallelized in principle.

更に、IピクチャにはPピクチャやBピクチャに比べて多くの符号量が配分される。このため、ピクチャ全体の2値化シンボルの平均発生量に比べてIピクチャの2値化シンボルの発生量は多い。その上、急激に発生符号量が増加したとき、レート制御が破綻することを防ぐためにMBごとの発生符号量を早期にレート制御に反映させる必要がある。このように、算術符号化回路114には、処理サイクル数がかかるにもかかわらず、並列化が不可能で、しかも発生符号量の多いIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できるだけの性能が必要となるという問題がある。   Furthermore, a larger amount of code is allocated to the I picture than to the P picture and the B picture. For this reason, the amount of occurrence of binarized symbols in the I picture is larger than the average amount of binarized symbols in the entire picture. In addition, when the generated code amount suddenly increases, the generated code amount for each MB needs to be reflected in the rate control at an early stage in order to prevent the rate control from failing. In this way, the arithmetic coding circuit 114 is able to reduce the amount of binarized symbols generated suddenly in an I picture that cannot be parallelized and has a large amount of generated codes, despite the number of processing cycles. There is a problem that performance sufficient for processing is required.

なお、CABACに関して実際の算術符号化は行わずに2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定する方法が提案されている(例えば、非特許文献6のp.20、図6参照)。具体的には、2値化シンボル長N
と直前の符号化済みピクチャの2値化シンボル長と発生符号量との比率αを用いて、発生符号量R=α×Nと推定するものである。ルックアップテーブルを用いれば多値のシンタックスデータを2値化シンボルに1CKで変換することが可能であるため、この方法を用いれば算術符号化の発生符号量の推定をシンタックスデータ当たり1CKで行うことができる。
渡辺浩巳,茶木英明,”H.264とMPEG-4に両対応 携帯機器向けコーデック・コアを開発 VGAの動画を36mAで符号化”,日経エレクトロニクス,2004年9月27日号,no.883,pp123-133. 南俊宏,長沼次郎,“テレスコピック探索に適した動きベクトル検出器構成法の提案”,信学論(D−2),vol.J87-D-2,no.11,pp.2007-2024,Nov.2004. S. Yoshihara, M. Kikuchi, Y. Ito, Y. Inada, S. Kuramochi, H. Wakabayashi, M. Okano, K. Koseki,H. Kuriyama, J. Inutsuka,A. Tajima, T. Nakajima, Y.Kudoh, F. Koga, Y. Kasagi, S. Watanabe, T. Nomoto, “A 1/1.8-inch 6.4MPixel 60frames/s CMOS Image Sensor with Seamless ModeChange”, ISSCC2006, session 27.1, Feb. 2006. 長沼次郎,岩崎裕江,新田高庸,中村健,吉留健,小倉充雄,中島靖之,田代豊,大西隆之,池田充郎,遠藤真,八島由幸,“1チップHDTV MPEG-2 CODEC LSI構成技術――VASA”,NTT技術ジャーナル,vol.15,No.9,pp.12-15,2003年9月. 野垣智士,“MPEG−2 MP@HLエンコーダにおける符号化制御方式の検討”,PCSJ98,P-2.04,pp.17-18,1998年10月. 山影朋夫,中條健,古藤 晋一郎,” HD DVD に用いる動画像符号化技術“,東芝レビュー,vol.60,No.1,pp.17-29,2005. H.264/AVC referencesoftware ( JM 10.2 ).
Note that there has been proposed a method for estimating the generated code amount of arithmetic coding from the sum of the symbol lengths of binarized symbols without performing actual arithmetic coding for CABAC (for example, p. 20 of Non-Patent Document 6). FIG. 6). Specifically, binarized symbol length N
The generated code amount R = α × N is estimated using the ratio α between the binary symbol length of the immediately previous encoded picture and the generated code amount. Since it is possible to convert multi-level syntax data into binarized symbols with 1 CK using a lookup table, this method can be used to estimate the amount of code generated by arithmetic coding at 1 CK per syntax data. It can be carried out.
Hiroaki Watanabe, Hideaki Chaki, “Developed codec core for mobile devices compatible with both H.264 and MPEG-4, encoded VGA video with 36 mA”, Nikkei Electronics, September 27, 2004, no.883, pp123-133. Toshihiro Minami and Jiro Naganuma, “Proposal of Motion Vector Detector Configuration Suitable for Telescopic Search”, Theory of Science (D-2), vol.J87-D-2, no.11, pp.2007-2024, Nov .2004. S. Yoshihara, M. Kikuchi, Y. Ito, Y. Inada, S. Kuramochi, H. Wakabayashi, M. Okano, K. Koseki, H. Kuriyama, J. Inutsuka, A. Tajima, T. Nakajima, Y. Kudoh, F. Koga, Y. Kasagi, S. Watanabe, T. Nomoto, “A 1 / 1.8-inch 6.4MPixel 60frames / s CMOS Image Sensor with Seamless ModeChange”, ISSCC2006, session 27.1, Feb. 2006. Jiro Naganuma, Hiroe Iwasaki, Takahiro Nitta, Ken Nakamura, Ken Yoshidome, Mitsuo Ogura, Yasuyuki Nakajima, Yutaka Tashiro, Takayuki Onishi, Mitsuru Ikeda, Makoto Endo, Yoshiyuki Yashima, “One-chip HDTV MPEG-2 CODEC LSI Configuration Technology— VASA ", NTT Technical Journal, vol.15, No.9, pp.12-15, September 2003. Satoshi Nogaki, “Examination of coding control method in MPEG-2 MP @ HL encoder”, PCSJ98, P-2.04, pp.17-18, October 1998. Ikuo Yamakage, Takeshi Nakajo, Shinichiro Furuto, “Video coding technology for HD DVD”, Toshiba Review, vol.60, No.1, pp.17-29, 2005. H.264 / AVC reference software (JM 10.2).

本発明は上記事情に鑑み、MBパイプライン構造の動画像符号化装置において、隣接ブロックの処理結果を符号化中のブロックの処理にフィードバック可能とすることを目的とする。具体的には、左隣接MBの発生符号量に応じて現MBをレート制御すること、隣接ブロックの動きベクトルの符号量を考慮して符号化中のブロックの動きベクトルを検出すること、左隣接MBのイントラ予測/インター予測判定結果を考慮して符号化中のブロックの動きベクトルを検出すること、隣接ブロックの再生画素を用いてイントラ予測モードを決定すること、およびPピクチャとBピクチャで左隣接MBの再生画素を用いて予測値を作成してイントラ予測を行うことを目的とする。   In view of the above circumstances, an object of the present invention is to enable feedback of the processing result of an adjacent block to the processing of a block being encoded in a moving picture encoding apparatus having an MB pipeline structure. Specifically, rate control of the current MB according to the generated code amount of the left adjacent MB, detection of the motion vector of the block being encoded in consideration of the code amount of the motion vector of the adjacent block, left adjacent Detecting the motion vector of the block being encoded in consideration of the MB intra prediction / inter prediction determination result, determining the intra prediction mode using the reproduced pixels of the adjacent block, and left P picture and B picture An object of the present invention is to perform intra prediction by creating a prediction value using a reproduction pixel of an adjacent MB.

また、本発明は、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる動画像符号化装置を提供することを目的とする。   It is another object of the present invention to provide a moving picture coding apparatus that can reduce the amount of data transferred from an external memory that stores pictures to the internal memory of the moving picture coding apparatus.

更に、本発明は、符号化に要する遅延が小さい並列画像符号化装置を提供することを目的とする。   It is another object of the present invention to provide a parallel image encoding apparatus that requires a small delay for encoding.

また、本発明は、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化可能とすることを目的とする。   It is another object of the present invention to enable arithmetic coding even when the arithmetic coding circuit does not have a performance sufficient to handle a binarized symbol generation amount that suddenly increases.

第1発明の動画像符号化装置は、動画像符号化の処理を複数のステージに分割してパイプライン的に実行する第1の手段と、縦に連続するm(mは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択する第2の手段と、前記第2の手段によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記第1の手段に設定する第3の手段とを有し、前記第3の手段によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要なデータが前記第1の手段に設定されると、前記第2の手段は、前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択することを特徴とする。   The moving picture coding apparatus according to the first aspect of the present invention is the first means for dividing the moving picture coding process into a plurality of stages and executing it in a pipeline, and m that is vertically continuous (m is an integer of 2 or more). A macroblock row, and for a macroblock belonging to the uppermost macroblock row in the group of macroblock rows, a macroblock for which the lower left adjacent macroblock has not yet been selected is selected; and For macroblocks belonging to macroblock rows other than the topmost in the group of macroblock rows, by selecting a macroblock in which the upper right adjacent macroblock has already been selected, the group of macroblock rows is changed to the group of macroblock rows. A second means for selecting one included macroblock per macroblock row; and the second means. For each selected macroblock, the macroblock belonging to the uppermost macroblock row in the group of macroblock rows to the macroblock belonging to the lowermost macroblock row takes m macroblock cycles. And, in turn, third means for setting in the first means the data necessary to encode individual macroblocks per macroblock cycle, and the third means When data necessary for encoding a macroblock belonging to the lowest macroblock row in the macroblock row is set in the first means, the second means sends the selected individual For each macroblock, the right adjacent macroblock is newly selected.

第2発明の動画像符号化装置は、縦に隣接する2つのマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置であって、動画像符号化の処理を複数のステージに分割してパイプライン的に実行する第1の手段と、縦に連続する2n(nは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペアを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つ以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペアを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペアを2マクロブロック行当たり1個選択する第2の手段と、前記第2の手段によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロックを構成し、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックを構成し、一方、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロックを構成し、マクロブロックペアの下半分のラインで下フレームマクロブロックを構成する第3の手段と、前記第2の手段によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータを前記第1の手段に設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち最初に設定されなかった他の片方を符号化するために必要なデータを前記第1の手段に設定し、一方、フレーム符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータを前記第1の手段に設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータを前記第1の手段に設定する第4の手段とを有し、前記第4の手段によって、2回目に、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記第1の手段に設定されると、前記第2の手段は、前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペアを新たに選択することを特徴とする。   A moving picture coding apparatus according to a second aspect of the present invention is a moving picture coding apparatus that combines two vertically adjacent macro blocks into a macro block pair, and switches between field coding and frame coding for each macro block pair. In this case, the first means for dividing the moving picture coding process into a plurality of stages and executing it in a pipeline, and 2n (n is an integer of 2 or more) continuous macroblock rows are grouped. And for a macroblock pair belonging to the top two macroblock rows in the group of macroblock rows, select a macroblock pair for which the lower left adjacent macroblock pair has not yet been selected, and A macroblock pair belonging to a macroblock row other than the uppermost two macroblock rows in the group of macroblock rows; A second means for selecting one macroblock pair included in the group of macroblock rows per two macroblock rows by selecting a macroblock pair whose upper right adjacent macroblock pair has already been selected; When field coding is selected for the macroblock pair selected by the second means, a top field macroblock is formed by an odd line of the macroblock pair, and a bottom field macro is formed by an even line of the macroblock pair. When a frame is selected, on the other hand, when the frame coding is selected, an upper frame macroblock is formed by the upper half line of the macroblock pair, and a lower frame macroblock is formed by the lower half line of the macroblock pair. According to the third means and the second means When field encoding is selected for the selected macroblock pair, first, from the macroblock pairs belonging to the top two macroblock rows in the group of macroblock rows, the Macros included in each macroblock pair in each macroblock cycle in order over n macroblock cycles up to the macroblock pair belonging to the two lowest macroblock rows in a group of macroblock rows Data necessary for encoding one of the blocks is set in the first means, and the second time, the macroblocks belonging to the two highest macroblock rows in the group of macroblock rows From the pair, the two bottommost macros in the group of macroblock rows The other one not set first among the macroblocks included in each macroblock pair is encoded in order of n macroblock cycles until the macroblock pair belonging to the blackblock row in order of n macroblock cycles. When the frame encoding is selected, the first two macroblock rows located at the top of the group of macroblock rows are set in the first means. From a macroblock pair belonging to a macroblock pair belonging to the lowest two macroblock rows in the group of macroblock rows to each macroblock cycle in order over n macroblock cycles. To encode the upper frame macroblock included in the macroblock pair of The necessary data is set in the first means, and from the macroblock pair belonging to the top two macroblock rows in the batch of macroblock rows, the batch of macroblocks is set a second time. The bottom frame macroblock included in each macroblock pair is encoded every one macroblock cycle in order over n macroblock cycles up to the macroblock pair belonging to the two lowest macroblock rows in the row And a fourth means for setting the data necessary for conversion into the first means, and the fourth means sets the lowest position in the group of macroblock rows by the fourth means. The data necessary for encoding the macroblocks included in the macroblock pairs belonging to the two macroblock rows If set to a first means, said second means is characterized by newly selecting the right neighboring macroblock pair for each individual macroblock pair being the selected.

第3発明の動画像符号化装置は、請求項1または請求項2記載の発明において、前記第1の手段における一部のステージで、マクロブロックサイクルがサブブロックサイクルに分割され、サブブロックサイクルではサブブロックごとの処理が行われることを特徴とする。   According to a third aspect of the present invention, there is provided the moving image encoding apparatus according to the first or second aspect, wherein the macroblock cycle is divided into sub-block cycles at some stages of the first means, The processing is performed for each sub-block.

第4発明の並列動画像符号化装置は、請求項1から請求項3までのいずれか1項に記載された動画像符号化装置をa台(aは2以上の整数)含む並列動画像符号化装置であって、ピクチャが前記ひとまとまりのマクロブロック行ごとに分割され、この分割された分割領域ごとに1台の動画像符号化装置が割り当てられ、a個の縦に連続した分割領域がa台の動画像符号化装置によって並列に符号化されることを特徴とする。   A parallel moving image encoding apparatus according to a fourth aspect of the present invention is a parallel moving image code including a number of moving image encoding apparatuses according to any one of claims 1 to 3 (where a is an integer of 2 or more). A picture is divided for each group of macroblock rows, and one moving picture coding apparatus is assigned to each divided divided area, and a vertically divided divided area includes Coding is performed in parallel by a number of moving image coding apparatuses.

第5発明の動画像符号化装置は、請求項1から請求項4までのいずれか1項記載の発明において、シンタックスデータを2値化シンボルに変換する2値化手段と、前記2値化手段によって変換された2値化シンボルを記憶する2値化シンボル記憶手段と、前記2値化シンボル記憶手段から読み出した2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元手段と、前記2値化シンボル記憶手段から読み出した2値化シンボルを、前記コンテクスト情報復元手段により復元されたコンテクスト情報に基づいて算術符号化する算術符号化手段とを有することを特徴とする。   The moving picture encoding apparatus according to a fifth aspect of the present invention is the video encoding apparatus according to any one of the first to fourth aspects, wherein the binarizing means converts the syntax data into a binarized symbol, and the binarization. Binarized symbol storing means for storing the binarized symbol converted by the means, context information restoring means for restoring the context information corresponding to the binarized symbol read from the binarized symbol storing means, and the 2 Arithmetic coding means for arithmetically coding the binarized symbol read from the binarized symbol storage means based on the context information restored by the context information restoration means.

第6発明の動画像符号化装置は、請求項5記載の発明において、前記2値化手段により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化手段を有することを特徴とする。   A moving picture encoding apparatus according to a sixth aspect of the present invention is the provisional arithmetic encoding means according to claim 5, wherein the binary symbols converted by the binarizing means are provisionally arithmetically encoded to calculate a provisionally generated code amount. It is characterized by having.

第7発明の動画像符号化装置は、請求項1から請求項4までのいずれか1項記載の発明において、シンタックスデータを可逆圧縮するシンタックスデータ圧縮手段と、前記シンタックスデータ圧縮手段により圧縮されたシンタックスデータを記憶する圧縮シンタックスデータ記憶手段と、前記圧縮シンタックスデータ記憶手段から圧縮されたシンタックスデータを読み出してシンタックスデータを復元するシンタックスデータ復元手段と、前記シンタックスデータ復元手段により復元されたシンタックスデータを2値化シンボルに変換する2値化手段と、前記2値化手段によって変換された2値化シンボルを算術符号化する算術符号化手段とを有することを特徴とする。   According to a seventh aspect of the present invention, there is provided the moving image encoding apparatus according to any one of the first to fourth aspects, wherein the syntax data compressing unit reversibly compresses the syntax data and the syntax data compressing unit. Compression syntax data storage means for storing compressed syntax data, syntax data restoration means for reading the compressed syntax data from the compression syntax data storage means and restoring the syntax data, and the syntax Binarizing means for converting the syntax data restored by the data restoring means into binarized symbols; and arithmetic coding means for arithmetically encoding the binarized symbols converted by the binarizing means. It is characterized by.

第8発明の動画像符号化装置は、請求項1から請求項4までのいずれか1項記載の発明において、シンタックスデータを2値化シンボルに変換する2値化手段と、前記2値化手段により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化手段と、シンタックスデータをCAVLC符号化するCAVLC符号化手段と、前記CAVLC符号化手段により生成されたCAVLC符号化ビットストリームを記憶するCAVLC符号化ビットストリーム記憶手段と、前記CAVLC符号化ビットストリーム記憶手段からCAVLC符号化ビットストリームを読み出してシンタックスデータを復号するCAVLC復号手段と、前記CAVLC復号手段によって復号されたシンタックスデータを2値化シンボルに変換する第2の2値化手段と、前記第2の2値化手段によって変換された2値化シンボルを算術符号化する算術符号化手段と、を有することを特徴とする。   According to an eighth aspect of the present invention, there is provided the moving image encoding apparatus according to any one of the first to fourth aspects, wherein the binarization means converts the syntax data into a binarized symbol, and the binarization. Generated by provisional arithmetic coding means for calculating a provisional generated code amount by provisional arithmetic coding of the binarized symbols converted by the means, CAVLC coding means for CAVLC coding the syntax data, and the CAVLC coding means CAVLC encoded bitstream storage means for storing the generated CAVLC encoded bitstream, CAVLC decoding means for reading the CAVLC encoded bitstream from the CAVLC encoded bitstream storage means and decoding the syntax data, and the CAVLC decoding The syntax data decoded by the means is converted into a binary symbol And second binarization means, and having a an arithmetic encoding means for arithmetic encoding of binary symbols converted by the second binarizing means.

第9発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割してパイプライン的に実行する符号化手段を有する動画像符号化装置において、縦に連続するm(mは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択する第1の手順と、前記第1の手順によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第2の手順とを有し、前記第2の手順によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要なデータが前記符号化手段に設定されると、前記第1の手順に戻り、前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択することを特徴とする。   A moving picture coding method according to a ninth aspect of the present invention is a moving picture coding apparatus having coding means for performing moving picture coding processing in a plurality of stages and executing it in a pipeline manner. Is a group of macroblock rows of 2 or more), and for the macroblocks belonging to the uppermost macroblock row in the group of macroblock rows, the macroblock whose lower left adjacent macroblock has not yet been selected And for the macroblocks belonging to the macroblock row other than the topmost macroblock row in the group of macroblock rows, the macroblock whose upper right adjacent macroblock has already been selected is selected. Select one macroblock per macroblock row in a group of macroblock rows And the macros belonging to the lowermost macroblock row from the macroblocks belonging to the uppermost macroblock row in the group of macroblock rows for the individual macroblocks selected by the first step A second procedure for setting data necessary for encoding individual macroblocks for each macroblock cycle in the encoding means in order over m macroblock cycles until the block, When the data necessary for encoding the macroblock belonging to the lowest macroblock row in the group of macroblock rows is set in the encoding means by the procedure of 2, the first procedure is followed. Returning, the right adjacent macroblock is newly selected for each of the selected macroblocks. To.

第10発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割してパイプライン的に実行する符号化手段を有し、縦に隣接する2つのマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置において、縦に連続する2n(nは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペアを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つ以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペアを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペアを2マクロブロック行当たり1個選択する第1の手順と、前記第1の手順により選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロックを構成し、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックを構成し、一方、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロックを構成し、マクロブロックペアの下半分のラインで下フレームマクロブロックを構成する第2の手順と、前記第1の手順によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータを前記符号化手段に設定し、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第3の手順と、前記第1の手順によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち前記第3の手順により設定されなかった他の片方を符号化するために必要なデータを前記符号化手段に設定し、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第4の手順とを有し、前記第4の手順によって、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記符号化手段に設定されると、前記第1の手順に戻り、前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペアを新たに選択することを特徴とする。   A moving picture coding method according to a tenth aspect of the present invention has coding means for dividing a moving picture coding process into a plurality of stages and executing it in a pipeline, and combining two macro blocks vertically adjacent to each other to create a macro In a moving image encoding apparatus that performs block encoding and switching between field encoding and frame encoding for each macroblock pair, 2n (n is an integer of 2 or more) continuous macroblock rows are grouped. , For a macroblock pair belonging to the top two macroblock rows in the group of macroblock rows, select a macroblock pair for which the lower left neighboring macroblock pair has not yet been selected, and A macroblock belonging to a macroblock line other than the topmost one in a group of macroblock lines For a pair, a first macroblock pair included in the group of macroblock rows is selected per two macroblock rows by selecting a macroblock pair whose upper right adjacent macroblock pair has already been selected. When field encoding is selected for the macroblock pair selected by the procedure and the first procedure, the top field macroblock is configured by the odd line of the macroblock pair and the bottom line by the even line of the macroblock pair. When a field macroblock is configured and frame encoding is selected, the upper frame macroblock is configured with the upper half line of the macroblock pair and the lower frame macroblock is configured with the lower half line of the macroblock pair. Second procedure to configure and the first procedure Thus, when field encoding is selected for the selected macroblock pair, the macroblock pair belonging to the two most macroblock rows in the group of macroblock rows is One of the macroblocks included in each macroblock pair in each macroblock cycle in order over n macroblock cycles up to the macroblock pair belonging to the two lowest macroblock rows in the macroblock row On the other hand, when the frame encoding is selected, the two macroblock rows located at the top of the group of macroblock rows are set in the encoding means. In the group of macroblock rows from the macroblock pairs belonging to In order to encode the upper frame macroblock included in each macroblock pair every n macroblock cycles in order over n macroblock cycles up to the macroblock pair belonging to the two lowest macroblock rows When the field encoding is selected for the macro block pair selected by the first procedure and the macro block pair selected by the first procedure, the data required for the group of macro block rows is set. N macroblock cycles from a macroblock pair belonging to the top two macroblock rows to a macroblock pair belonging to the bottommost two macroblock rows in the group of macroblock rows In turn, each macroblock every macroblock cycle Data necessary for encoding the other one not set by the third procedure among the macroblocks included in the block pair is set in the encoding means, while when frame encoding is selected , Belonging to the two lowest macroblock rows in the group of macroblock rows from the macroblock pairs belonging to the two uppermost macroblock rows in the group of macroblock rows Up to n macroblock cycles up to a macroblock pair, data necessary for encoding the lower frame macroblock included in each macroblock pair is set in the encoding means for each macroblock cycle. 4 in the group of macroblock rows by the fourth procedure. When data necessary for encoding a macroblock included in a macroblock pair belonging to two macroblock rows located below is set in the encoding means, the process returns to the first procedure, and the selection is performed. For each individual macroblock pair, the right adjacent macroblock pair is newly selected.

第1の発明によれば、縦に連続するm(mは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択されたm個のMBを1個のMBパイプラインに連続して投入するので、左隣接MBの処理結果を(m−1)ステージ分現MBの処理にフィードバックできる。また、選択されたm個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。   According to the first invention, m MB rows (m is an integer of 2 or more) that are vertically continuous are taken as a group, and one MB is selected per MB row from the group of MB rows, Since these selected m MBs are continuously input into one MB pipeline, the processing result of the left adjacent MB can be fed back to the processing of the (m−1) stage fractional MB. In addition, since the reference areas of the selected m MBs are largely overlapped, if the reference area of these MBs is stored in the common reference area memory, the external memory storing the pictures There is no need to duplicate transfer for updating the overlapped portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

第2の発明によれば、縦に連続する2n(nは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、縦に連続する2つのMB行当たり1つのMBペアを選択し、最初に、これら選択されたn個のMBペアに含まれる片方のMBを1個のMBパイプラインに連続して投入し、2回目に、これら選択されたn個のMBペアに含まれる残りの片方のMBを1個のMBパイプラインに連続して投入するので、最初に投入する片方のMBの処理結果を(n−1)ステージ分残りの片方のMBの処理にフィードバックでき、かつ、左隣接MBペアの処理結果を(n−1)ステージ分現MBペアの処理にフィードバックできる。また、前記選択された2n個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。   According to the second aspect of the present invention, 2n (n is an integer of 2 or more) MB rows that are vertically continuous are taken as a group, and one MB pair per two MB rows that are vertically continuous from the batch of MB rows. First, one MB included in the selected n MB pairs is continuously input to one MB pipeline, and the second time, the selected n MB pairs are transferred to the selected n MB pairs. Since the remaining one of the included MBs is continuously input to one MB pipeline, the processing result of the first MB to be input can be fed back to the processing of the remaining one MB for (n-1) stages. In addition, the processing result of the left adjacent MB pair can be fed back to the processing of the (n−1) stage partial MB pair. Further, since the reference areas of the selected 2n MBs are largely overlapped with each other, if the reference areas of these MBs are stored in a common reference area memory, the external memory storing the pictures This eliminates the need for duplicate transfer for updating the overlapped portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

第3の発明によれば、マクロブロックパイプラインの一部のステージで、サブブロックごとの処理をパイプライン的に行うことができる。この発明によれば、隣接サブブロックの処理結果を符号化中のサブブロックの処理にフィードバックとすることも可能となる。   According to the third invention, processing for each sub-block can be performed in a pipeline manner at some stages of the macroblock pipeline. According to the present invention, the processing result of the adjacent subblock can be fed back to the processing of the subblock being encoded.

第4の発明によれば、並列動作するa台の動画像符号化装置の参照領域は縦に大きく重なっているので、外部メモリから並列動画像符号化装置の内部メモリへ全ての動画像符号化装置の参照領域を転送し、内部メモリから個々の動画像符号化装置に転送する構成とすれば、参照領域の重なり部分を重複して転送する必要がなくなる。このため、並列動画像符号化装置に内部メモリを設けることにより、ピクチャを記憶している外部メモリから並列動画像符号化装置の内部メモリへのデータ転送量を削減できる。また、従来のスライスインタリーブと異なり、各々の動画像符号化装置が分担して符号化する領域ごとにスライス分割する必要はなく、ピクチャ全体を1スライスとすることも可能である。更に、a台の動画像符号化装置が処理するピクチャの最初の領域が入力されると、動画像符号化装置は符号化を開始することができるので、符号化遅延を抑えることができる。   According to the fourth aspect of the invention, since the reference areas of the a moving image encoders operating in parallel overlap each other vertically, all the moving image encodings are performed from the external memory to the internal memory of the parallel moving image encoder. If the configuration is such that the reference area of the device is transferred and transferred from the internal memory to each moving picture encoding device, it is not necessary to transfer overlapping portions of the reference area in duplicate. For this reason, by providing an internal memory in the parallel video encoding device, it is possible to reduce the amount of data transferred from the external memory storing pictures to the internal memory of the parallel video encoding device. Further, unlike the conventional slice interleaving, it is not necessary to divide the slices for each area to be encoded by each moving picture coding apparatus, and the entire picture can be made into one slice. Furthermore, when the first region of a picture to be processed by the a number of moving image encoding devices is input, the moving image encoding device can start encoding, and thus encoding delay can be suppressed.

第5の発明によれば、前記第1〜第4の発明が適用された動画像符号化装置においてH.264で規定されるCABAC等の算術符号化を行う場合であっても、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行うことができる。このため、あるMBの発生符号量が突発的に増加した場合に、次に符号化するMBの量子化パラメータを早急に大きくし、新たに符号化するMBから発生する符号量を減少させるようにレート制御することができる。また、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができる。特に、2値化シンボル記憶回路にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路の性能がIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できる性能を下回っていても算術符号化することができるという効果がある。   According to a fifth aspect of the present invention, there is provided a video encoding apparatus to which the first to fourth aspects of the invention are applied. Even when arithmetic coding such as CABAC defined in H.264 is performed, rate control can be performed before the coding of all MBs included in a group of MB rows that are vertically continuous is completed. For this reason, when the generated code amount of a certain MB suddenly increases, the quantization parameter of the MB to be encoded next is quickly increased, and the code amount generated from the newly encoded MB is decreased. Rate control is possible. In addition, arithmetic coding can be performed even if the arithmetic coding circuit does not have a performance sufficient to process a binarized symbol generation amount that suddenly increases. In particular, if the binarized symbol storage circuit has sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the performance of the arithmetic coding circuit can be improved. There is an effect that arithmetic coding can be performed even if the performance of the binarized symbol generation amount suddenly generated in the I picture is less than the capability of processing.

第6の発明によれば、上記第5の発明と同様の効果に加えて、シーンチェンジ等があった場合でも真の算術符号化による発生符号量に基づくレート制御に近いレート制御を行うことができるという効果がある。   According to the sixth invention, in addition to the same effect as the fifth invention, it is possible to perform rate control close to rate control based on the generated code amount by true arithmetic coding even when there is a scene change or the like. There is an effect that can be done.

第7の発明によれば、第5の発明同様、前記第1〜第4の発明が適用された動画像符号化装置においてH.264で規定されるCABAC等の算術符号化を行う場合であっても、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行うことができる。このため、あるMBの発生符号量が突発的に増加した場合に、次に符号化するMBの量子化パラメータを早急に大きくし、新たに符号化するMBから発生する符号量を減少させるようにレート制御することができる。また、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができる。特に、2値化シンボル記憶回路にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路の性能がIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できる性能を下回っていても算術符号化することができるという効果がある。   According to the seventh invention, as in the fifth invention, in the moving picture coding apparatus to which the first to fourth inventions are applied, the Even when arithmetic coding such as CABAC defined in H.264 is performed, rate control can be performed before the coding of all MBs included in a group of MB rows that are vertically continuous is completed. For this reason, when the generated code amount of a certain MB suddenly increases, the quantization parameter of the MB to be encoded next is quickly increased, and the code amount generated from the newly encoded MB is decreased. Rate control is possible. In addition, arithmetic coding can be performed even if the arithmetic coding circuit does not have a performance sufficient to process a binarized symbol generation amount that suddenly increases. In particular, if the binarized symbol storage circuit has sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the performance of the arithmetic coding circuit can be improved. There is an effect that arithmetic coding can be performed even if the performance of the binarized symbol generation amount suddenly generated in the I picture is less than the capability of processing.

第8の発明によれば、上記第7の発明と同様の効果に加えて、あるMBの2値化シンボルの発生量が突発的に増加し、仮算術符号化した結果真の算術符号化回路の処理能力を超えると予測されるときにはそのMBを含むピクチャ全体をCAVLC符号化し、一方、仮算術符号化した結果真の算術符号化回路で処理できると予測されるときにはそのMBを含むピクチャ全体をCABAC符号化することができる。これにより、真の算術符号化回路の性能が不測するという状況を確実に回避できる効果が得られる。更に、CAVLC符号化回路でCAVLC符号化ビットストリームの符号量を算出し、CAVLC符号化と仮算術符号化の仮発生符号量を比較して、ピクチャごとに発生符号量が少ないと推測されるエントロピー符号化モードを選択することもできる。   According to the eighth invention, in addition to the same effects as in the seventh invention, the amount of binarized symbols generated in a certain MB suddenly increases, and as a result of provisional arithmetic coding, a true arithmetic coding circuit When it is predicted that the processing capacity of the MB will be exceeded, the entire picture including the MB is CAVLC encoded. On the other hand, when it is predicted that it can be processed by a true arithmetic encoding circuit as a result of provisional arithmetic encoding, the entire picture including the MB is encoded. CABAC encoding can be performed. As a result, it is possible to reliably avoid the situation where the performance of the true arithmetic coding circuit is unexpected. Furthermore, the CAVLC encoding circuit calculates the code amount of the CAVLC encoded bitstream, compares the temporarily generated code amount of CAVLC encoding and provisional arithmetic encoding, and entropy that is estimated to be small for each picture. An encoding mode can also be selected.

第9発明の発明によれば、第1の発明同様、縦に連続するm(mは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択されたm個のMBを1個のMBパイプラインに連続して投入するので、左隣接MBの処理結果を(m−1)ステージ分現MBの処理にフィードバックできる。また、前記選択されたm個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。   According to the ninth aspect of the invention, as in the first aspect, m (m is an integer of 2 or more) MB rows that are vertically continuous are taken as a group, and one MB row is selected from the set of MB rows. Since the selected m MBs are continuously input to one MB pipeline, the processing result of the left adjacent MB is fed back to the processing of the (m-1) stage differential MB. it can. In addition, since the reference areas of the selected m MBs are largely overlapped, if the reference areas of these MBs are stored in the common reference area memory, the external memory storing the pictures This eliminates the need for duplicate transfer for updating the overlapped portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

第10の発明によれば、第2の発明同様、縦に連続する2n(nは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、縦に連続する2つのMB行当たり1つのMBペアを選択し、最初に、これら選択されたn個のMBペアに含まれる片方のMBを1個のMBパイプラインに連続して投入し、2回目に、これら選択されたn個のMBペアに含まれる残りの片方のMBを1個のMBパイプラインに連続して投入するので、最初に投入する片方のMBの処理結果を(n−1)ステージ分残りの片方のMBの処理にフィードバックでき、かつ、左隣接MBペアの処理結果を(n−1)ステージ分現MBペアの処理にフィードバックできる。また、前記選択された2n個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。   According to the tenth invention, as in the second invention, 2n (n is an integer of 2 or more) MB rows that are continuous vertically are taken as a group, and two MBs that are vertically continuous are taken from the batch of MB rows. Select one MB pair per row, and first put one MB included in these selected n MB pairs into one MB pipeline in succession, and these are selected the second time Since the remaining one MB included in the n MB pairs is continuously input to one MB pipeline, the processing result of the first MB to be input first is (n-1) stages of the remaining one. It is possible to feed back to the processing of the MB, and it is possible to feed back the processing result of the left adjacent MB pair to the processing of the (n−1) stage partial MB pair. Further, since the reference areas of the selected 2n MBs are largely overlapped with each other, if the reference areas of these MBs are stored in a common reference area memory, the external memory storing the pictures This eliminates the need for duplicate transfer for updating the overlapped portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

本発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。   In the present invention, a plurality of MB rows that are vertically continuous are grouped, one MB is selected per MB row from the group of MB rows, and the selected plurality of MBs are one MB. Put continuously into the pipeline.

以下、本発明の実施の形態に係る動画像符号化装置、動画像符号化方法および算術符号化装置を図面に基づいて説明する。   Hereinafter, a moving picture coding apparatus, a moving picture coding method, and an arithmetic coding apparatus according to embodiments of the present invention will be described with reference to the drawings.

図1はMBパイプラインに連続して投入されるMBの例を示した説明図である。図1のピクチャはa行からl行までの12のMB行からなり、各MB行は0番目から15番目までの16個のMBで構成される。図1のピクチャでは、最初にa−MB行、b−MB行、c−MB行、d−MB行に含まれるMBが1個のMBパイプラインで符号化され、次にe−MB行、f−MB行、g−MB行、h−MB行に含まれるMBが1個のMBパイプラインで符号化され、最後にi−MB行、j−MB行、k−MB行、l−MB行に含まれるMBが1個のMBパイプラインで符号化される。図1中のe行10列、f行8列、g行6列、h行4列のMBは1個のMBパイプラインに連続して投入されるMBの一例である。f行8列のMBはe行10列のMBから左方向に2MB離れている。同様にg行6列のMBはf行8列のMBから左方向に2MB離れており、h行4列のMBはg行6列のMBから左方向に2MB離れている。これらの4つのMBは相互に左隣接、上隣接、または右上隣接のいずれの隣接関係にもない。以下では、複数のブロックが相互に左隣接、上隣接、または右上隣接のいずれの隣接関係にもないことを、これらのブロックは隣接関係にないという。   FIG. 1 is an explanatory diagram showing an example of MBs that are continuously input to the MB pipeline. The picture in FIG. 1 is composed of 12 MB rows from a row to l row, and each MB row is composed of 16 MBs from 0th to 15th. In the picture of FIG. 1, first, MBs included in the a-MB row, b-MB row, c-MB row, and d-MB row are encoded by one MB pipeline, and then the e-MB row, MBs included in the f-MB line, the g-MB line, and the h-MB line are encoded by one MB pipeline, and finally the i-MB line, the j-MB line, the k-MB line, and the l-MB. MB included in a row is encoded by one MB pipeline. The MB of e row 10 column, f row 8 column, g row 6 column, and h row 4 column in FIG. 1 is an example of an MB that is continuously input to one MB pipeline. The MB in f row and 8 columns is 2 MB away from the MB in e row and 10 columns in the left direction. Similarly, the MB of g row 6 column is 2 MB away from the MB of f row 8 column leftward, and the MB of h row 4 column is 2 MB away from the MB of g row 6 column leftward. These four MBs are not adjacent to each other in the left adjacent, the upper adjacent, or the upper right adjacent. In the following, it is said that these blocks are not adjacent to each other when the plurality of blocks are not adjacent to each other in the left adjacent, the upper adjacent, or the upper right adjacent.

図2は本発明が適用される動画像符号化装置のブロック図を示す。MB選択回路2は、図1に示すように、e−MB行、f−MB行、g−MB行、h−MB行をひとまとまりとし、e−MB行に属するMBについては、左下隣接MBがまだ選択されていないMBを選択し、かつ、f−MB行、g−MB行、およびh−MB行に属するMBについては、右上隣接MBが既に選択されているMBを選択することによって、e行10列、f行8列、g行6列、h行4列のMBを選択する。符号化データ設定回路3は、e行10列、f行8列、g行6列、h行4列のMBの順番で、各MBを符号化するために必要なデータをMBパイプライン1に設定する。MBを符号化するために必要なデータがMBパイプライン1に設定されると、そのMBはMBパイプライン1に投入される。h行4列のMBを符号化するために必要なデータがMBパイプライン1に設定され、h行4列のMBがMBパイプライン1に投入されると、MB選択回路2は、e行11列、f行9列、g行7列、h行5列のMBを新たに選択する。   FIG. 2 shows a block diagram of a moving picture coding apparatus to which the present invention is applied. As shown in FIG. 1, the MB selection circuit 2 collects the e-MB row, the f-MB row, the g-MB row, and the h-MB row, and the MBs belonging to the e-MB row By selecting an MB that has not yet been selected and, for MBs belonging to f-MB, g-MB, and h-MB rows, by selecting an MB for which the upper right neighboring MB has already been selected, The MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column is selected. The encoded data setting circuit 3 sends data necessary for encoding each MB to the MB pipeline 1 in the order of MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column. Set. When data necessary for encoding an MB is set in the MB pipeline 1, the MB is input to the MB pipeline 1. When the data necessary for encoding the MB of h rows and 4 columns is set in the MB pipeline 1 and the MB of h rows and 4 columns is input to the MB pipeline 1, the MB selection circuit 2 A new MB of column, f row 9 column, g row 7 column, h row 5 column is selected.

図3は本発明が適用される動画像符号化方法の処理のフローチャートを示す。e−MB行、f−MB行、g−MB行、h−MB行をひとまとまりとし、e−MB行に属するMBについては、左下隣接MBがまだ選択されていないMBを選択し、かつ、f−MB行、g−MB行、およびh−MB行に属するMBについては、右上隣接MBが既に選択されているMBを選択することによって、e行10列、f行8列、g行6列、h行4列のMBを選択する(ステップS1)。次に、e行10列、f行8列、g行6列、h行4列のMBの順番で、各MBを符号化するために必要なデータをMBパイプライン1に設定し、順次MBパイプラインに投入する(ステップS2、ステップS3)。MBを符号化するために必要なデータがMBパイプライン1に設定されると、そのMBはMBパイプライン1に投入される。h行4列のMBを符号化するために必要なデータがMBパイプライン1に設定され、h行4列のMBがMBパイプライン1に投入されると、ステップS1に戻り(ステップS4)、e行11列、f行9列、g行7列、h行5列のMBを新たに選択する(ステップS1)。   FIG. 3 shows a flowchart of the process of the moving picture encoding method to which the present invention is applied. e-MB line, f-MB line, g-MB line, and h-MB line are grouped, and for MBs belonging to the e-MB line, an MB for which the lower left neighboring MB is not yet selected is selected; and For MBs belonging to the f-MB row, the g-MB row, and the h-MB row, by selecting the MB for which the upper right adjacent MB has already been selected, the e row 10 column, the f row 8 column, the g row 6 An MB with 4 columns and h rows is selected (step S1). Next, data necessary for encoding each MB is set in the MB pipeline 1 in the order of MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column, Input into the pipeline (steps S2 and S3). When data necessary for encoding an MB is set in the MB pipeline 1, the MB is input to the MB pipeline 1. When the data necessary for encoding the MB of h rows and 4 columns is set in the MB pipeline 1 and the MB of h rows and 4 columns is input to the MB pipeline 1, the process returns to step S1 (step S4). MBs of e row 11 column, f row 9 column, g row 7 column, h row 5 column are newly selected (step S1).

これら4個のMBを1個のMBパイプライン1に連続して投入したときに、各MBがMBパイプライン1の各ステージを流れていく様子を図4に示す。ステージ0からステージ6の各処理内容は図45のものと同じである。また、図1のピクチャを構成する各MBがMBパイプライン1に投入され、ステージ0の処理が開始されるMBサイクル番号を図5に示す。図4に示すように、e行10列、f行8列、g行6列、h行4列の4個のMBは、MBサイクル番号がそれぞれ104、105、106、107のとき順番にステージ0に投入され、MBサイクル番号がそれぞれ110、111、112、113のとき順番にステージ6に達して符号化が終了する。このように、ひとまとまりの4つのMB行の中で、最も上のMB行に属するMB、上から2番目のMB行に属するMB、上から3番目のMB行に属するMB、上から4番目のMB行に属するMBの順番にMBパイプライン1に投入され、続いてそれらの右隣接MBが同様の順番でMBパイプライン1に投入される。   FIG. 4 shows a state in which each MB flows through each stage of the MB pipeline 1 when these four MBs are continuously input to one MB pipeline 1. The processing contents of stage 0 to stage 6 are the same as those in FIG. FIG. 5 shows MB cycle numbers at which the MBs constituting the picture of FIG. 1 are input to the MB pipeline 1 and the stage 0 process is started. As shown in FIG. 4, four MBs of e row 10 column, f row 8 column, g row 6 column, h row 4 column are staged in order when the MB cycle numbers are 104, 105, 106, and 107, respectively. When the MB cycle numbers are 110, 111, 112, and 113, respectively, the stage 6 is reached in order and the encoding is completed. Thus, among a group of four MB rows, the MB belonging to the uppermost MB row, the MB belonging to the second MB row from the top, the MB belonging to the third MB row from the top, the fourth from the top The MBs that belong to the MB row are input to the MB pipeline 1 in the order of MBs, and then the right adjacent MBs are input to the MB pipeline 1 in the same order.

本発明によれば、本実施例のようにひとまとまりとして符号化するMB行の数が4のとき、左隣接MBの処理結果を3ステージ分フィードバックし、現MBの処理に反映できる。このため、図4中に矢印で示すように、例えば、f行7列のMBの高精度の動き検出結果とイントラ予測結果をf行8列のMBの粗い精度の動き検出に反映できる。このように、従来の技術と異なり、左に隣接したMBの高精度の動き検出結果とイントラ予測結果を考慮して現MBの動きベクトルを選択することができる。また、同様に矢印で示すように、f行7列のMBの動き補償の結果をf行8列のMBのイントラ予測に反映できる。従って、従来の技術と異なり、左に隣接したMBの動き補償により求められた再生画素を用いて現MBのイントラ予測を行うことができる。更に、f行7列のMBのレート制御結果をf行8列のMBの量子化に反映できる。このように、左に隣接したMBのレート制御結果に応じて現MBの量子化パラメータを修正することができる。   According to the present invention, when the number of MB rows to be encoded as a group is four as in this embodiment, the processing result of the left adjacent MB can be fed back by three stages and reflected in the processing of the current MB. For this reason, as indicated by an arrow in FIG. 4, for example, the high-precision motion detection result and the intra prediction result of the f-row 7-column MB can be reflected in the coarse-precision motion detection of the f-row 8-column MB. Thus, unlike the conventional technique, the motion vector of the current MB can be selected in consideration of the high-precision motion detection result and intra prediction result of the MB adjacent to the left. Similarly, as indicated by an arrow, the result of motion compensation of the MB of f rows and 7 columns can be reflected in the intra prediction of MBs of f rows and 8 columns. Therefore, unlike the conventional technique, intra prediction of the current MB can be performed using the reconstructed pixel obtained by motion compensation of the MB adjacent to the left. Further, the rate control result of the MB of f rows and 7 columns can be reflected in the quantization of MBs of f rows and 8 columns. In this way, the quantization parameter of the current MB can be corrected according to the rate control result of the MB adjacent to the left.

ここで、本実施例では下に隣接したMB行に含まれるMBが上のMB行中のMBから左方向に2MB離れている場合を示したが、2MB以上離れていれば良く、例えば3MB離れていても本発明の目的を達成することができ、同様の作用・効果を生じる。また、縦に連続する4つのMB行をひとまとまりとして、これら4つのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された4個のMBを1個のMBパイプラインに連続して投入する例を示したが、ひとまとまりのMB行の数は2以上であれば良く、例えば縦に連続する8つのMB行をひとまとまりとして、これら8つのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された8個のMBを1個のMBパイプラインに連続して投入しても本発明の目的を達成することができ、同様の作用・効果を生じる。ただし、ひとまとまりのMB行の数が2のときは、左隣接MBの処理結果を1ステージ分しか現MBの処理にフィードバックできないため、図4のステージ構成では左隣接MBの動き補償とレート制御の結果をそれぞれ現MBのイントラ予測と整数変換・量子化・逆量子化・逆整数変換にフィードバックできない。ひとまとまりのMB行の数が2のときは、図4に示したものとステージ構成を変更する必要がある。   Here, in this embodiment, the case where the MB included in the MB row adjacent to the lower side is 2 MB away from the MB in the upper MB row in the left direction is shown. However, the object of the present invention can be achieved, and the same action and effect are produced. Also, taking four MB rows that are vertically continuous as one group, one MB per MB row is selected from these four MB rows, and these four MBs are selected as one MB pipeline. However, it is sufficient that the number of MB lines in a group is two or more. For example, eight MB lines that are vertically continuous are grouped, and one of these eight MB lines is used as one group. Even if one MB is selected per MB row, and the selected 8 MBs are continuously input to one MB pipeline, the object of the present invention can be achieved, and similar operations and effects can be achieved. Produce. However, when the number of MB rows in a group is 2, the processing result of the left adjacent MB can be fed back to the current MB processing for only one stage. Therefore, in the stage configuration of FIG. Cannot be fed back to the current MB intra prediction and integer transform / quantization / inverse quantization / inverse integer transform. When the number of MB lines in a group is 2, it is necessary to change the stage configuration from that shown in FIG.

図6は8画素×8画素の4つのSB(以下、8×8SBという。)に分割されたMBを示す。本実施例では、4つの8×8SBについて動きベクトルのコストと予測誤差のコストの和が最小となる動きベクトルを検出する例について示す。一般に、PMVと動きベクトルの距離が遠いほど動きベクトルのコストは高いと評価される。このため、各8×8SBについて動き検出を始める前に、その8×8SBのPMVが決まっていなければならない。そして、例えば、左隣接8×8SB、上隣接8×8SB、右上隣接8×8SBの動きベクトルに基づいてPMVを決めるとすると、図6中の0、1、2、3の番号を付された順番に8×8SBごとの動きベクトルを検出しなければならないことになる。ただし、3番の8×8SBの動きベクトル検出時に右上隣接8×8SBの動きベクトルは存在しないため、3番の8×8SBのPMVは1番と2番の8×8SBの動きベクトルMV1とMV2に基づいて決められる。   FIG. 6 shows an MB divided into four SBs of 8 pixels × 8 pixels (hereinafter referred to as 8 × 8SB). In the present embodiment, an example will be described in which a motion vector that minimizes the sum of the cost of a motion vector and the cost of a prediction error is detected for four 8 × 8 SBs. Generally, it is estimated that the cost of a motion vector is higher as the distance between the PMV and the motion vector is longer. For this reason, before starting motion detection for each 8 × 8 SB, the 8 × 8 SB PMV must be determined. For example, if PMV is determined based on the motion vector of the left adjacent 8 × 8SB, the upper adjacent 8 × 8SB, and the upper right adjacent 8 × 8SB, the numbers 0, 1, 2, and 3 in FIG. The motion vectors for every 8 × 8 SB must be detected in order. However, since the motion vector of the upper right 8 × 8SB does not exist when the third 8 × 8SB motion vector is detected, the third 8 × 8SB PMV is the first and second 8 × 8SB motion vectors MV1 and MV2. It is decided based on.

図7はMBパイプラインに連続して投入されるMBの例を示した説明図である。図7のピクチャはa行から始まっており、r行の下方にもMB行が存在する。また、16列以降にもMBが存在する。本実施例ではi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとして、これらひとまとまりのMB行から、i行15列、j行13列、k行11列、l行9列、m行7列、n行5列、o行3列、p行1列のMBを選択し、これら選択された8つのMBを1個のMBパイプラインに連続して投入する例を示す。   FIG. 7 is an explanatory diagram showing an example of MBs continuously input into the MB pipeline. The picture in FIG. 7 starts from the a line, and there is an MB line below the r line. There are also MBs after the 16th column. In the present embodiment, the i-MB line, j-MB line, k-MB line, l-MB line, m-MB line, n-MB line, o-MB line, and p-MB line are grouped together. Select MB of i row 15 column, j row 13 column, k row 11 column, l row 9 column, m row 7 column, n row 5 column, o row 3 column, p row 1 column from a group of MB rows. An example is shown in which these eight selected MBs are continuously input into one MB pipeline.

図8は8×8SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示す。図9は本発明が適用される動きベクトル検出回路12のブロック図を示す。外部メモリ4には単画素精度の画像が記憶されている。ステージ0で外部メモリ4から画像を読み出す。その画像を2画素精度画像作成回路5で縮小して2画素精度の画像を作成し、2画素精度メモリ6に書き込む。ステージ1で2画素精度メモリ5から画像を読み出しながら、2画素精度動き検出回路7により2画素精度の候補動きベクトルを検出する。そして、ステージ2で候補ベクトルの周辺の領域を外部メモリ4から読み出して、単画素精度メモリ8に書き込む。ここで、一般に外部の大容量メモリは低速であるため、外部メモリ4から単画素精度メモリ8に転送するために1ステージ割り当てている。単画素精度メモリ8から2画素精度候補ベクトルの周辺の領域を読み出しながら、ステージ3で単画素精度動き検出回路9により動きベクトルを検出する。その後、ステージ4で単画素精度メモリ8から単画素精度画素を読み出して、1/4画素精度画像作成回路10で1/4画素精度の画像を作成しながら1/4画素精度動きベクトル検出回路11を用いて1/4画素精度動きベクトル検出を行う。単画素精度メモリ8からは単画素精度動き検出回路9と1/4画素精度画像作成回路10に単画素精度画像を供給することになるため、単画素精度メモリ8はダブルバッファ構成や2リード以上可能な多ポートメモリとする必要がある。なお、図8ではステージ4で単画素精度動きベクトルの周囲を直接探索して1/4画素精度動きベクトルを検出するとしたが、ステージ4で半画素精度動きベクトルを検出した後、ステージ5で半画素精度動きベクトルの周囲を探索して1/4画素精度動きベクトルを検出しても良い。また、ステージ3で単画素精度動きベクトル検出と半画素精度動きベクトル検出を行い、ステージ4で1/4画素精度動きベクトル検出を行っても良い。   FIG. 8 shows how each MB flows through each stage when MBs included in 8 MB rows are continuously input to one MB pipeline in order to detect a motion vector every 8 × 8 SB. Show. FIG. 9 shows a block diagram of a motion vector detection circuit 12 to which the present invention is applied. The external memory 4 stores an image with single pixel accuracy. At stage 0, an image is read from the external memory 4. The image is reduced by the two-pixel precision image creation circuit 5 to create a two-pixel precision image and written in the two-pixel precision memory 6. While reading an image from the two-pixel accuracy memory 5 in the stage 1, the two-pixel accuracy motion detection circuit 7 detects a candidate motion vector with two-pixel accuracy. Then, in stage 2, the area around the candidate vector is read from the external memory 4 and written to the single pixel precision memory 8. Here, since an external large-capacity memory is generally low-speed, one stage is allocated for transfer from the external memory 4 to the single pixel precision memory 8. While reading the area around the two-pixel accuracy candidate vector from the single-pixel accuracy memory 8, the motion vector is detected by the single-pixel accuracy motion detection circuit 9 in the stage 3. Thereafter, the single pixel precision pixel is read from the single pixel precision memory 8 at the stage 4, and the quarter pixel precision motion vector detection circuit 11 is created while creating the quarter pixel precision image by the quarter pixel precision image creation circuit 10. Is used to perform 1/4 pixel precision motion vector detection. Since the single pixel accuracy memory 8 supplies a single pixel accuracy image to the single pixel accuracy motion detection circuit 9 and the ¼ pixel accuracy image creation circuit 10, the single pixel accuracy memory 8 has a double buffer configuration or more than two reads. It must be possible multi-port memory. In FIG. 8, the surrounding of the single-pixel accuracy motion vector is directly searched at stage 4 to detect the 1 / 4-pixel accuracy motion vector. However, after detecting the half-pixel accuracy motion vector at stage 4, A ¼ pixel accuracy motion vector may be detected by searching around the pixel accuracy motion vector. Alternatively, single-pixel precision motion vector detection and half-pixel precision motion vector detection may be performed in stage 3, and quarter-pixel precision motion vector detection may be performed in stage 4.

ステージ1〜ステージ5ではMBサイクルを4つのSBサイクルに分割し、各SBサイクルで8×8SBごとの処理を行う。ここで、SBサイクルとは、1個のSBが処理されるために要する時間の単位をいい、SBごとの処理を行うとき、MBサイクルはSBサイクルに分割される。以下では、MBサイクルがSBサイクルに分割され、SBごとの処理を行うステージ群をSBパイプライン(またはサブブロックパイプライン)と呼ぶ。図8中のステージ1〜ステージ5がSBパイプラインである。図10はSBパイプラインの詳細な動作を示す。−0、−1、−2、−3はそれぞれ図6中の0、1、2、3の番号を付された8×8SBを意味する。例えば、i15−2はi行15列のMBに含まれる2番目の8×8SBを表す。図10では、ステージ5に空ステージを挿入し、例えばi15−0SBについてステージ4で検出された1/4画素精度動きベクトルをi15−1SBのステージ1における2画素精度動きベクトルのコスト計算に反映できるようにしている。このように、MBサイクルをSB数に等しい数のSBサイクルに分割したときは、(SB数+1)段のパイプラインとすることにより、同一のMB内における前の8×8SBの処理結果を次の8×8SBに反映させることができる。   In stages 1 to 5, the MB cycle is divided into four SB cycles, and each 8 × 8 SB process is performed in each SB cycle. Here, the SB cycle means a unit of time required for processing one SB, and when performing processing for each SB, the MB cycle is divided into SB cycles. Hereinafter, the stage group in which the MB cycle is divided into SB cycles and processing for each SB is performed is referred to as an SB pipeline (or sub-block pipeline). Stages 1 to 5 in FIG. 8 are SB pipelines. FIG. 10 shows the detailed operation of the SB pipeline. −0, −1, −2 and −3 mean 8 × 8SB numbered 0, 1, 2, 3 in FIG. For example, i15-2 represents the second 8 × 8SB included in the MB of i rows and 15 columns. In FIG. 10, an empty stage is inserted into the stage 5, and for example, a ¼ pixel precision motion vector detected in the stage 4 for i15-0SB can be reflected in the cost calculation of the 2-pixel precision motion vector in the stage 1 of i15-1SB. I am doing so. As described above, when the MB cycle is divided into the number of SB cycles equal to the number of SBs, the processing result of the previous 8 × 8 SB in the same MB is obtained by setting a pipeline of (SB number + 1) stages. Of 8 × 8SB.

なお、ステージ1〜ステージ5において8×8SBごとの動きベクトル検出回路と並列に動作するMBごとの動きベクトル検出回路を設けることが可能である。また、ステージ3〜5において、ステージ1において検出された8×8SBごとの候補ベクトルの周辺領域で8×8SBごとの動きベクトル検出と並列にMBごと、16画素×8画素SBごと、8画素×16画素SBごとの動きベクトルを検出することも可能である。   In stage 1 to stage 5, it is possible to provide a motion vector detection circuit for each MB that operates in parallel with a motion vector detection circuit for each 8 × 8 SB. Further, in stages 3 to 5, in the peripheral region of the candidate vectors for each 8 × 8SB detected in stage 1, motion vector detection for each 8 × 8SB is performed in parallel with the motion vector detection for each 8 × 8SB, for each 16 pixels × 8 pixels SB, for 8 pixels × It is also possible to detect a motion vector for every 16 pixels SB.

ステージ0〜5において動きベクトルが検出された後は、ステージ6で16×16イントラ予測モード、4×4イントラ予測モード、インター予測モード等の中から符号化効率の最も良くなる予測モードが選択される。ステージ7では整数変換、量子化、逆量子化、および逆整数変換が行われる。ステージ8では可変長符号化と動き補償が行われる。ステージ9ではレート制御とデブロッキングフィルタ処理が行われ、ステージ10では再生画素や符号化ビットストリームが外部メモリ4に書き込まれる。   After motion vectors are detected in stages 0 to 5, a prediction mode with the highest coding efficiency is selected from 16 × 16 intra prediction mode, 4 × 4 intra prediction mode, inter prediction mode, and the like in stage 6. The In stage 7, integer transformation, quantization, inverse quantization, and inverse integer transformation are performed. In stage 8, variable length coding and motion compensation are performed. In stage 9, rate control and deblocking filter processing are performed. In stage 10, the reproduced pixels and the encoded bit stream are written in the external memory 4.

本実施例では、1/4画素精度動き検出回路11を2個設け、ステージ3とステージ4を結合して、1個の8×8SBの1/4画素精度動き検出を2SBサイクルかけて行う例を示す。ステージ3とステージ4以外は、実施例2のMBパイプラインと同一のステージ構成である。図11はSBパイプラインの詳細な動作を示し、図12はこの動作を実現するための動き検出回路13のブロック図を示す。2つの1/4画素精度動き検出回路11を1SBサイクルずらして動作させることにより、個々の8×8SBの1/4画素精度動き検出を2SBサイクルかけて行うことができる。   In this embodiment, two 1/4 pixel precision motion detection circuits 11 are provided, and the stage 3 and the stage 4 are combined to perform one 8 × 8SB 1/4 pixel precision motion detection over 2SB cycles. Indicates. Except stage 3 and stage 4, the stage configuration is the same as that of the MB pipeline of the second embodiment. FIG. 11 shows the detailed operation of the SB pipeline, and FIG. 12 shows a block diagram of the motion detection circuit 13 for realizing this operation. By operating the two quarter-pixel precision motion detection circuits 11 with a shift of 1 SB cycle, each 8 × 8 SB quarter-pixel precision motion detection can be performed over 2 SB cycles.

本実施例では、H.264における4画素×4画素イントラ予測(以下、4×4イントラ予測という。)に本発明を適用する例ついて説明する。図13は16個の4画素×4画素SB(以下、4×4SBという。)に分割されたMBを示す。4×4SBは図13中に付した0〜15の順番で符号化され、ビットストリームに変換される。例えば、3番の4×4SBについて4×4イントラ予測を行うときには、1番の4×4SBにおける下端4行の画素と2番の4×4SBの右端4列の画素が参照される。また、14番の4×4SBについて4×4イントラ予測を行うときには、12番と13番の4×4SBにおける下端の4行の画素と11番の4×4SBにおける右端4列の画素が参照される。これら隣接4×4SBに属する画素は再生画素を用いることが望ましい。   In this embodiment, H. An example in which the present invention is applied to 4 pixel × 4 pixel intra prediction in H.264 (hereinafter referred to as 4 × 4 intra prediction) will be described. FIG. 13 shows an MB divided into 16 4 pixels × 4 pixels SB (hereinafter referred to as 4 × 4 SB). 4 × 4SB is encoded in the order of 0 to 15 in FIG. 13 and converted into a bit stream. For example, when 4 × 4 intra prediction is performed for the third 4 × 4SB, the pixels at the bottom 4 rows and the pixels at the right 4 × 4SB at the second 4 × 4SB are referred to. In addition, when performing 4 × 4 intra prediction for the 14th 4 × 4SB, the pixels at the bottom four rows in the 12th and thirteenth 4 × 4SB and the pixels at the rightmost four columns in the 11th 4 × 4SB are referred to. The As the pixels belonging to these adjacent 4 × 4 SBs, it is desirable to use reproduced pixels.

図14は、4×4イントラ予測のために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示す。ステージ4で隣接4×4SBの再生画素を用いて4×4イントラ予測を行い、ステージ5で予測誤差に対して整数変換・量子化・逆整数変換・逆量子化を行ってイントラ予測値を加算し、再生画素を生成する。ステージ4の4×4イントラ予測回路とステージ5の整数変換・量子化・逆整数変換・逆量子化回路は、実施例2または実施例3で示したステージ1〜ステージ5の動き検出回路と並列に動作する。   FIG. 14 shows a state where each MB flows through each stage when MBs included in eight MB rows are continuously input to one MB pipeline for 4 × 4 intra prediction. Stage 4 performs 4 × 4 intra prediction using adjacent 4 × 4 SB reconstructed pixels, and stage 5 performs integer transformation, quantization, inverse integer transformation, and inverse quantization on the prediction error, and adds the intra prediction value Then, a reproduction pixel is generated. The 4 × 4 intra prediction circuit of stage 4 and the integer transform / quantization / inverse integer transform / inverse quantization circuit of stage 5 are in parallel with the motion detection circuits of stage 1 to stage 5 shown in the second or third embodiment. To work.

本実施例では、ステージ4と5においてMBサイクルを16のSBサイクルに分割する。このため、SBパイプラインのステージ数に比べてSBの数が多く、(SB数+1)段のSBパイプラインとすると、空ステージが増加し、効率が悪い。図15はSBパイプラインの詳細な動作を示す。−0、−1、−2、……、−15はそれぞれ図13中の0、1、2、……、15の番号を付された4×4SBを意味する。例えば、i15−8はi行15列のMBに含まれる8番目の4×4SBを表す。図15に示すように、本実施例では、2つのMBに含まれる4×4SBを交互に処理することにより、1つのMBを2MBサイクル、すなわち32SBサイクルかけて処理する。1つのMBに属する4×4SBを4×4イントラ予測しているとき、同時に別のMBに属する4×4SBを整数変換・量子化・逆整数変換・逆量子化する。MBサイクルごとに1つのMBの処理を開始し、別のMBの処理を終えるように動作させ、MBパイプラインの他ステージと整合を取る。ただし、このように動作させると、図15に示すように、ステージ4の4×4イントラ予測において、2MBサイクルごとに1SBサイクル、すなわち1/16MBサイクルだけMBサイクルとずれが発生する。そのため、図15では、ステージ3の有効期間を15/16MBサイクルとし、ステージ4における1/16MBサイクルのずれを吸収している。なお、ステージ3の処理が重く、無効期間を設けることができないときは、ステージ6の有効期間を15/16MBサイクルとし、1/16MBサイクルのずれを吸収しても良い。このように動作させることにより、4×4イントラ予測回路と整数変換・量子化・逆整数変換・逆量子化を行う回路に空を生じることなく、左隣接、上隣接、右上隣接の4×4SBに属する画素について再生画素を用いて4×4イントラ予測を行うことができる。   In this embodiment, in stages 4 and 5, the MB cycle is divided into 16 SB cycles. For this reason, if the number of SBs is larger than the number of stages in the SB pipeline, and the number of SB pipelines is (SB number + 1), the number of empty stages increases, resulting in poor efficiency. FIG. 15 shows the detailed operation of the SB pipeline. −0, −1, −2,..., -15 means 4 × 4SB numbered 0, 1, 2,. For example, i15-8 represents the 8th 4 × 4SB included in the MB of i rows and 15 columns. As shown in FIG. 15, in this embodiment, 4 × 4 SB included in two MBs are alternately processed to process one MB over 2 MB cycles, that is, 32 SB cycles. When 4 × 4 SB belonging to one MB is subjected to 4 × 4 intra prediction, 4 × 4 SB belonging to another MB is simultaneously subjected to integer transform / quantization / inverse integer transform / inverse quantization. The processing of one MB is started every MB cycle, and the processing of another MB is finished, and matching with the other stages of the MB pipeline is performed. However, when operated in this way, as shown in FIG. 15, in the 4 × 4 intra prediction of stage 4, a deviation from the MB cycle occurs by 1 SB cycle, that is, 1/16 MB cycle every 2 MB cycles. Therefore, in FIG. 15, the effective period of stage 3 is set to 15/16 MB cycle, and the shift of 1/16 MB cycle in stage 4 is absorbed. When the stage 3 process is heavy and an invalid period cannot be provided, the valid period of the stage 6 may be set to 15/16 MB cycle, and the shift of 1/16 MB cycle may be absorbed. By operating in this way, the 4 × 4 intra prediction circuit and the 4 × 4 SB of the left adjacent, the upper adjacent, and the upper right adjacent are generated without generating a sky in the circuits that perform integer transform / quantization / inverse integer transform / inverse quantization. 4 × 4 intra prediction can be performed using the reconstructed pixels for the pixels belonging to.

なお、SBパイプラインの前または後のステージの有効期間を短縮するのではなく、SBパイプラインの前または後に空ステージを挿入することによって、MBパイプラインのずれを吸収することもできる。   It should be noted that the MB pipeline shift can be absorbed by inserting an empty stage before or after the SB pipeline, instead of shortening the effective period of the stage before or after the SB pipeline.

本実施例では、図14に矢印で示すように、左隣接MBのレート制御結果を4×4イントラ予測に付随して行う量子化に反映することができる。   In the present embodiment, as indicated by an arrow in FIG. 14, the rate control result of the left adjacent MB can be reflected in quantization performed in association with 4 × 4 intra prediction.

また、輝度信号の16画素×16画素イントラ予測や4:2:0フォーマットのときの色差信号の8画素×8画素イントラ予測はMBごとに処理される。このため、左隣接MBと上隣接MBに属する画素を参照できれば良い。この場合、ステージ8の動き補償で得られる再生画素を参照できるため、4×4イントラ予測のようにステージ5で整数変換・量子化・逆整数変換・逆量子化を行う必要はない。なお、ステージ6のイントラ・インター判定で4×4イントラ予測モードが選択された場合には、ステージ5の整数変換・量子化・逆整数変換・逆量子化で得られた再生画素を保存しておく構成としても、ステージ7で再度整数変換・量子化・逆整数変換・逆量子化を行う構成としても良い。   Further, 16 pixel × 16 pixel intra prediction of the luminance signal and 8 pixel × 8 pixel intra prediction of the color difference signal in the 4: 2: 0 format are processed for each MB. For this reason, it is only necessary to refer to pixels belonging to the left adjacent MB and the upper adjacent MB. In this case, since the reconstructed pixel obtained by the motion compensation in stage 8 can be referred to, there is no need to perform integer transformation / quantization / inverse integer transformation / inverse quantization in stage 5 as in 4 × 4 intra prediction. When the 4 × 4 intra prediction mode is selected in the intra / inter determination in stage 6, the reproduced pixels obtained by the integer transform, quantization, inverse integer transform, and inverse quantization in stage 5 are stored. Alternatively, the stage 7 may be configured to perform integer transformation / quantization / inverse integer transformation / inverse quantization again in the stage 7.

なお、4×4イントラ予測のモード判定を入力された画素によって行うことにすれば、ステージ5の整数変換・量子化・逆整数変換・逆量子化は省略することができる。ただし、再生画素を用いてモード判定した場合に比べ、画質は劣化する。   If the mode determination of 4 × 4 intra prediction is performed by the input pixels, the integer transformation / quantization / inverse integer transformation / inverse quantization in stage 5 can be omitted. However, the image quality is deteriorated as compared with the case where the mode is determined using the reproduction pixels.

本実施例では、実施例2〜4とほぼ同一のステージ構成のMBパイプラインにおいて、図7におけるi−MB行、j−MB行、k−MB行、l−MB行をひとまとまりとして、これらひとまとまりのMB行から、i行15列、j行13列、k行11列、l行9列等のMBを選択し、これら選択された4個のMBを1個のMBパイプラインに連続して投入する例を示す。実施例2〜4では8つのMB行をひとまとまりとして処理するため、各左隣接MBの処理結果を7ステージ分現MBの処理にフィードバックできるが、本実施例では3ステージ分しかフィードバックできない。このため、左隣接MBの処理結果を現MBの処理に反映するとき、実施例2〜4に比べて制限が生じる。   In the present embodiment, in the MB pipeline having substantially the same stage configuration as in the second to fourth embodiments, the i-MB row, j-MB row, k-MB row, and l-MB row in FIG. From a group of MB rows, select MBs such as i rows 15 columns, j rows 13 columns, k rows 11 columns, l rows 9 columns, etc., and these selected 4 MBs are connected to one MB pipeline. An example is shown below. In the second to fourth embodiments, since eight MB rows are processed as a group, the processing result of each left adjacent MB can be fed back to the processing of the seven stage equivalent MB, but in this embodiment, only three stages can be fed back. For this reason, when the processing result of the left adjacent MB is reflected in the processing of the current MB, there is a restriction compared to the second to fourth embodiments.

8×8SBごとの動きベクトルを検出するために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を図16に示す。この場合、例えば、ステージ5でj行12列のMBのイントラ・インター判定が終了したとき、同時にステージ1においてj行13列のMBの2画素精度動き検出も終了する。このため、左隣接MBのイントラ・インター判定結果を現MBの2画素精度動き検出に反映できないという制限がある。ただし、図16中に矢印で示すように、左隣接MBのイントラ・インター判定結果はステージ2以降に反映できる。また、左上隣接MB、上隣接MB、右上隣接MB、左方向に1つ離れたMB等についてステージ5で確定したイントラ・インター判定結果はステージ1の2画素精度動き検出に反映できる。そこで、ステージ1においては、左上隣接MB、上隣接MB、右上隣接MB、左方向に1つ離れたMB等の動きベクトルを参照して仮のPMVを作成し、4つの8×8SB全てが共通にこの仮のPMVを参照して2画素精度動き検出を行う。そして、ステージ2ではステージ1で検出された2画素精度の候補動きベクトルの周辺領域を単画素精度メモリ8に設定し、ステージ3で真のPMVを作成し、ステージ3とステージ4で真のPMVを参照して単画素精度動き検出と1/4画素精度動き検出を行う。   When MBs included in four MB rows are continuously input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB flows through each stage of the MB pipeline. Is shown in FIG. In this case, for example, when the intra / inter determination of the MB of j rows and 12 columns ends in stage 5, the 2-pixel precision motion detection of the MB of j rows and 13 columns ends simultaneously in stage 1. For this reason, there is a limitation that the intra / inter determination result of the left adjacent MB cannot be reflected in the two-pixel precision motion detection of the current MB. However, as indicated by arrows in FIG. 16, the intra / inter determination result of the left adjacent MB can be reflected in the stage 2 and subsequent stages. Also, the intra / inter determination result determined in stage 5 for the upper left adjacent MB, the upper adjacent MB, the upper right adjacent MB, the MB one left in the left direction, and the like can be reflected in the two-pixel accuracy motion detection in stage 1. Therefore, in stage 1, a temporary PMV is created with reference to motion vectors such as the upper left adjacent MB, the upper adjacent MB, the upper right adjacent MB, and the MB separated by one in the left direction, and all four 8 × 8 SBs are common. The two-pixel precision motion detection is performed with reference to the temporary PMV. In stage 2, the peripheral area of the candidate motion vector of 2-pixel accuracy detected in stage 1 is set in the single-pixel accuracy memory 8, a true PMV is created in stage 3, and a true PMV is created in stage 3 and stage 4. The single-pixel precision motion detection and the quarter-pixel precision motion detection are performed with reference to FIG.

図17はステージ3と4におけるSBパイプラインの詳細な動作を示す。ステージ3の単画素精度動き検出とステージ4の1/4画素精度動き検出では、2つのMBに含まれる8×8SBを交互に処理することにより、1つのMBを2MBサイクル、すなわち8SBサイクルかけて処理する。1個のMBに属する8×8SBについて単画素精度動き検出を行っているとき、同時に別のMBに属する8×8SBについて1/4画素精度動き検出を行う。MBサイクルごとに1個のMBの処理を開始し、別のMBの処理を終えるように動作させ、MBパイプラインの他ステージと整合を取る。そして、ステージ2の有効期間を3/4MBサイクルとし、ステージ4における1/4MBサイクルのずれを吸収する。この方法によれば、1つのMB内に含まれる4個の8×8SBについて0番から3番までシリアルに処理することができる。このため、単画素精度動き検出と1/4画素精度動き検出では隣接8×8SBの動きベクトルを考慮した真のPMVに基づいて動き検出を行うことができる。   FIG. 17 shows the detailed operation of the SB pipeline in stages 3 and 4. In single-pixel precision motion detection of stage 3 and quarter-pixel precision motion detection of stage 4, by processing 8 × 8SB included in two MBs alternately, one MB takes 2 MB cycles, that is, 8SB cycles. Process. When single pixel precision motion detection is performed for 8 × 8SB belonging to one MB, ¼ pixel precision motion detection is simultaneously performed for 8 × 8SB belonging to another MB. The processing of one MB is started for each MB cycle, and the processing is performed so as to finish the processing of another MB, so as to be consistent with the other stages of the MB pipeline. Then, the effective period of stage 2 is set to 3/4 MB cycle, and the shift of 1/4 MB cycle in stage 4 is absorbed. According to this method, four 8 × 8 SBs included in one MB can be serially processed from No. 0 to No. 3. For this reason, in the single-pixel precision motion detection and the quarter-pixel precision motion detection, it is possible to perform motion detection based on a true PMV in consideration of the adjacent 8 × 8 SB motion vector.

ただし、本実施例では、空間ダイレクトアドレスの評価が別途必要となる。ステージ1で仮のPMVに基づいて2画素精度動き検出が行われ、ステージ2ではステージ1で検出された候補動きベクトルの周辺領域が単画素精度メモリ8に設定される。ステージ1の仮のPMVとステージ3の真のPMVが異なる場合、ステージ3と4で動き検出する領域に空間ダイレクトアドレスに対応する位置のMBや8×8SB等が含まれない。そこで、ステージ3およびステージ4と並列に空間ダイレクトアドレスに対応する位置のMBや8×8SBのコストを評価する処理を行う必要がある。   However, in this embodiment, it is necessary to separately evaluate the space direct address. In stage 1, 2-pixel precision motion detection is performed based on the temporary PMV, and in stage 2, the peripheral area of the candidate motion vector detected in stage 1 is set in the single-pixel precision memory 8. When the temporary PMV of stage 1 and the true PMV of stage 3 are different, the motion detection areas in stages 3 and 4 do not include MB or 8 × 8 SB at the position corresponding to the spatial direct address. Therefore, it is necessary to perform processing for evaluating the MB of the position corresponding to the spatial direct address and the cost of 8 × 8 SB in parallel with stage 3 and stage 4.

4×4イントラ予測のために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を図18に示す。また、図19はステージ3と4におけるSBパイプラインの詳細な動作を示す。ステージ4の4×4イントラ予測とステージ5の整数変換・量子化・逆量子化・逆整数変換では、実施例4のSBパイプラインと同様の処理を行う。   FIG. 18 shows how each MB flows through each stage of the MB pipeline when MBs included in four MB rows are continuously input to one MB pipeline for 4 × 4 intra prediction. Show. FIG. 19 shows the detailed operation of the SB pipeline in stages 3 and 4. In the 4 × 4 intra prediction in stage 4 and the integer transformation / quantization / inverse quantization / inverse integer transformation in stage 5, the same processing as in the SB pipeline in the fourth embodiment is performed.

ただし、本実施例では左隣接MBの処理結果を3ステージ分しか現MBの処理にフィードバックできないため、動き補償をステージ7で行うと左隣接MBの再生画素を用いて4×4イントラ予測を行うことができない。そこで、動き補償をステージ6で行なわなければならないという制限がある。また、左隣接MBのステージ8のレート制御結果を反映できるのはステージ5以降であって、ステージ4の量子化には反映できない。しかし、ステージ7の可変長符号化によって大量のビットが発生し、ステージ8で量子化パラメータを大きくするというレート制御を行う必要が生じる場合がある。この場合には、ステージ5のイントラ・インター判定において4×4イントラ予測モードを選択しないようにするか、または4×4イントラ予測モードが選択されたときはステージ6で新しい量子化パラメータを用いて整数変換・量子化・逆量子化・逆整数変換をやり直す必要がある。   However, in this embodiment, since the processing result of the left adjacent MB can be fed back to the current MB processing for only three stages, if motion compensation is performed in stage 7, 4 × 4 intra prediction is performed using the reproduced pixels of the left adjacent MB. I can't. Therefore, there is a limitation that motion compensation must be performed at stage 6. The rate control result of stage 8 of the left adjacent MB can be reflected after stage 5 and cannot be reflected in the quantization of stage 4. However, there are cases where a large amount of bits are generated by variable length coding in stage 7 and it is necessary to perform rate control to increase the quantization parameter in stage 8. In this case, the 4 × 4 intra prediction mode is not selected in the intra / inter determination of stage 5, or when the 4 × 4 intra prediction mode is selected, the new quantization parameter is used in stage 6 It is necessary to redo integer conversion, quantization, inverse quantization, and inverse integer conversion.

上記実施例1〜5で示したように、本発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。これらのMBは狭い画像領域にあるため、下に隣接したMB行に属するMBの符号化が終了するまで、そのMBの上隣接MBと右上隣接MBの再生画素や動きベクトル等を画像符号化装置内に保持することにしてもその保持に要する記憶回路の規模は小さい。この記憶回路を設けることにより、これら複数のMB行の一番上のMB行に含まれるMBを除いて、現MBの符号化のために上隣接MBと右上隣接MBの再生画素や動きベクトル等を供給するという問題を解消することができる。   As shown in the first to fifth embodiments, in the present invention, a plurality of MB rows that are vertically continuous are taken as a group, and one MB per MB row is selected from the group of MB rows, These selected MBs are continuously input to one MB pipeline. Since these MBs are in a narrow image area, the image encoding device is used to display the reproduction pixels, motion vectors, and the like of the upper adjacent MB and the upper right adjacent MB until the encoding of the MBs belonging to the adjacent MB row below ends. Even if it is held inside, the scale of the memory circuit required for the holding is small. By providing this memory circuit, except for the MB included in the uppermost MB row of the plurality of MB rows, reproduced pixels, motion vectors, etc. of the upper adjacent MB and the upper right adjacent MB for encoding the current MB Can be solved.

なお、実施例1〜5で示したMBパイプラインのステージ構成は一例であって、他のステージ構成とすることも可能である。そして、ステージ構成が変われば、ひとまとまりとして符号化する縦に連続する複数のMB行の数が同じであっても、動き検出やイントラ予測等における制約は変わる。   Note that the stage configuration of the MB pipeline shown in the first to fifth embodiments is an example, and other stage configurations may be used. If the stage configuration changes, the constraints in motion detection, intra prediction, and the like change even if the number of vertically continuous MB rows encoded as a group is the same.

図20は、内部メモリを有する動画像符号化装置23のブロック図である。動画像符号化装置23は、MBの符号化に必要な全てのデータを外部メモリ4から読み出してその内部メモリに記憶する。内部メモリは参照領域用メモリ14とバッファメモリ15の2種類ある。動き検出の時に参照される参照画像は参照領域用メモリ14に記憶され、参照領域用メモリ14から動き検出部16と動き補償部17に供給される。符号化のために必要なその他のデータはバッファメモリ15に記憶され、動き検出部16、動き補償部17、イントラ予測部18、整数変換・量子化・逆量子化・逆整数変換部19、可変長符号化部20、デブロッキングフィルタ部21はバッファメモリ15との間でデータを転送する。制御部22はイントラ・インター判定とレート制御を行う。制御部22はワイヤードロジックまたはマイクロプロセサで構成される。なお、図20では参照領域用メモリ14とバッファメモリ15を別々のものとして表わしたが、参照領域用アドレスとバッファ用アドレスが別れていれば1個の共通メモリであっても良い。   FIG. 20 is a block diagram of the video encoding device 23 having an internal memory. The moving image encoding device 23 reads all data necessary for MB encoding from the external memory 4 and stores the data in the internal memory. There are two types of internal memory: a reference area memory 14 and a buffer memory 15. The reference image to be referred to at the time of motion detection is stored in the reference area memory 14 and is supplied from the reference area memory 14 to the motion detection unit 16 and the motion compensation unit 17. Other data necessary for encoding is stored in the buffer memory 15, and includes a motion detection unit 16, a motion compensation unit 17, an intra prediction unit 18, an integer transform / quantization / inverse quantization / inverse integer transform unit 19, and a variable The long encoding unit 20 and the deblocking filter unit 21 transfer data to and from the buffer memory 15. The control unit 22 performs intra / inter determination and rate control. The control unit 22 is configured by a wired logic or a microprocessor. In FIG. 20, the reference area memory 14 and the buffer memory 15 are shown as separate ones. However, if the reference area address and the buffer address are separated, one common memory may be used.

縦に連続する4つのMB行に含まれる4個のMB24、25、26、27を1個のMBパイプラインで処理する場合の参照領域28、29、30、31を図21に示す。参照領域28、29、30、31はそれぞれMB24、25、26、27の動き検出のときに参照される領域である。参照領域28、29、30、31は大きく重なっており、縦に隣り合うMB行に属する2個のMBの参照領域において重なっていない部分の高さはMBの縦方向の画素数と一致する。この重なり部分は動きベクトルの検出範囲が広くなるほど大きくなる。本発明において参照領域28、29、30、31中の全画素は、参照領域用メモリ14に記憶される。従来技術と同様に、本実施例でも右方向に隣接するMBの符号化を開始するとき、外部メモリ4から参照領域用メモリ14へ更新領域32、33、34、35のみ転送し、それまで符号化していた左隣接MBの参照領域28、29、30、31の原点から次に符号化する右隣りのMBのための新しい原点に付け替える。ただし、MB25のための更新領域33は、MB24の参照領域28に含まれていない部分のみである。同様に、MB26とMB27の更新領域34、35はそれぞれMB25とMB26の参照領域29、30に含まれていない部分のみである。従って、従来技術に比べて、外部メモリ4と参照領域用メモリ14の間の画素転送量を大幅に削減することができる。   FIG. 21 shows reference areas 28, 29, 30, and 31 when four MBs 24, 25, 26, and 27 included in four vertically continuous MB rows are processed by one MB pipeline. Reference areas 28, 29, 30, and 31 are areas that are referred to when motions of MBs 24, 25, 26, and 27 are detected, respectively. The reference areas 28, 29, 30, and 31 are greatly overlapped, and the height of the non-overlapping portions in the reference areas of two MBs belonging to the vertically adjacent MB rows is equal to the number of pixels in the vertical direction of the MB. This overlapping portion becomes larger as the motion vector detection range becomes wider. In the present invention, all the pixels in the reference areas 28, 29, 30 and 31 are stored in the reference area memory 14. As in the prior art, in this embodiment, when encoding of the MB adjacent in the right direction is started, only the update areas 32, 33, 34, and 35 are transferred from the external memory 4 to the reference area memory 14, and the code is encoded so far. The origin of the reference area 28, 29, 30, 31 of the left adjacent MB that has been converted is changed to a new origin for the right adjacent MB to be encoded next. However, the update area 33 for the MB 25 is only a portion not included in the reference area 28 of the MB 24. Similarly, the update areas 34 and 35 of MB26 and MB27 are only portions not included in the reference areas 29 and 30 of MB25 and MB26, respectively. Therefore, the amount of pixel transfer between the external memory 4 and the reference area memory 14 can be greatly reduced as compared with the prior art.

図22は、参照領域用メモリ14に参照領域28、29、30、31を記憶するもう一つの方法である。参照領域用メモリ14には、参照領域28、29、30、31を全て含む矩形の領域36を記憶する。この方法によれば、参照領域用メモリ14のアドレス生成が簡単になる。また、更新領域37もひとまとまりの矩形領域となるため、外部メモリ4から参照領域用メモリ14への画素の転送が簡単になる。   FIG. 22 shows another method for storing the reference areas 28, 29, 30, and 31 in the reference area memory 14. The reference area memory 14 stores a rectangular area 36 that includes all the reference areas 28, 29, 30, and 31. According to this method, the address generation of the reference area memory 14 is simplified. Further, since the update area 37 is also a group of rectangular areas, transfer of pixels from the external memory 4 to the reference area memory 14 is simplified.

上記では、連続した4つのMB行に含まれる4つのMBを1個のMBパイプラインで同時に処理する場合を例として示したが、本実施例に示す方法は連続した2以上のMB行であれば適用でき、例えば連続した8のMB行であっても良い。   In the above, the case where four MBs included in four consecutive MB rows are simultaneously processed by one MB pipeline has been shown as an example. However, the method shown in the present embodiment may be performed on two or more consecutive MB rows. For example, it may be eight consecutive MB lines.

なお、参照領域用メモリ14には単画素精度画像のみ記憶し、参照領域用メモリ14から読み出した単画素精度画像から動き検出部16と動き補償部17の内部で半画素精度画像や1/4画素精度画像を作成する構成とすることができる。この構成は、予め半画素精度画像や1/4画素精度画像を作成して外部メモリ4に記憶し、外部メモリ4から参照領域用メモリ14に半画素精度画像や1/4画素精度画像を転送する構成よりも外部メモリ4と参照領域用メモリ14の間の画素転送量を削減することができる。   The reference region memory 14 stores only a single pixel accuracy image, and the single pixel accuracy image read out from the reference region memory 14 is used to generate a half pixel accuracy image or ¼ inside the motion detection unit 16 and the motion compensation unit 17. It can be set as the structure which produces a pixel precision image. In this configuration, a half-pixel precision image or a quarter-pixel precision image is created in advance and stored in the external memory 4, and the half-pixel precision image or the quarter-pixel precision image is transferred from the external memory 4 to the reference area memory 14. The pixel transfer amount between the external memory 4 and the reference area memory 14 can be reduced as compared with the configuration to be performed.

また、2画素精度画像等の縮小画像を作成し、最初に縮小画像上で動き検出を行い、段階的に高精度画像で動き検出を行う階層的探索法がある。この探索法に対して本発明を適用する場合にも、参照領域用メモリ14には単画素精度画像のみを記憶しておき、動き検出部16と動き補償部17の内部で縮小画像を作成する構成とすることができる。この構成は、予め縮小画像を作成して外部メモリ4に記憶し、外部メモリ4から参照領域用メモリ14に縮小画像を転送する構成よりも外部メモリ4と参照領域用メモリ14の間の画素転送量を削減することができる。   Further, there is a hierarchical search method in which a reduced image such as a two-pixel accuracy image is created, motion is first detected on the reduced image, and motion detection is performed on the high-accuracy image step by step. Even when the present invention is applied to this search method, only the single-pixel precision image is stored in the reference area memory 14, and a reduced image is created inside the motion detection unit 16 and the motion compensation unit 17. It can be configured. This configuration creates a reduced image in advance and stores it in the external memory 4, and transfers pixels between the external memory 4 and the reference region memory 14 rather than a configuration in which the reduced image is transferred from the external memory 4 to the reference region memory 14. The amount can be reduced.

その他、動き検出における演算量を削減する手法としてテレスコピック探索法が提案されている。テレスコピック探索法では、符号化対象画像と参照画像の中間の画像も必要となる。この場合には、中間の画像の中で動き検出に必要な領域に対しても本実施例に示す更新方法を適用することができる。   In addition, a telescopic search method has been proposed as a method for reducing the amount of calculation in motion detection. In the telescopic search method, an intermediate image between the encoding target image and the reference image is also required. In this case, the update method shown in this embodiment can be applied to a region necessary for motion detection in an intermediate image.

また、輝度信号だけを本実施例に示す方法で外部メモリ4から画像符号化装置23の内部メモリに転送しても良いし、輝度信号と色差信号の両方に本実施例に示す方法を適用しても良い。なお、動き検出のときに色差信号を参照しない場合には、色差信号は参照領域用メモリ14とバッファメモリ15のどちらに記憶しても良い。   Further, only the luminance signal may be transferred from the external memory 4 to the internal memory of the image encoding device 23 by the method shown in this embodiment, or the method shown in this embodiment is applied to both the luminance signal and the color difference signal. May be. If the color difference signal is not referred to during motion detection, the color difference signal may be stored in either the reference area memory 14 or the buffer memory 15.

HDTV映像を符号化対象とする場合、良好な画質を得るために動きベクトルの範囲は横±200画素、縦±100画素程度必要である。この範囲の動きベクトルを検出するための演算量は膨大であり、動き検出のために多くのサイクル数を要する。しかし、MBパイプライン構造の動画像符号化装置では、MBサイクル当たりのサイクル数は全てのステージで共通である。動き検出のためのステージのみMBサイクル当たりのサイクル数を増加させることはできない。また、本発明を適用したMBパイプラインでは、処理結果をフィードバックできるステージ数に限界があるため、MBパイプラインのステージ数を増加させることは好ましくない。   When HDTV video is to be encoded, the range of motion vectors needs to be about ± 200 pixels horizontally and ± 100 pixels vertically to obtain good image quality. The amount of computation for detecting a motion vector in this range is enormous, and a large number of cycles are required for motion detection. However, in a video encoding apparatus having an MB pipeline structure, the number of cycles per MB cycle is common to all stages. Only the stage for motion detection cannot increase the number of cycles per MB cycle. Also, in the MB pipeline to which the present invention is applied, there is a limit to the number of stages where the processing result can be fed back, so it is not preferable to increase the number of MB pipeline stages.

図23は広い範囲で動きを検出できる動き検出装置38と、本発明が適用されたMBパイプラインを含む動画像符号化装置23の組み合わせを示す。動き検出装置38は、動きベクトルの符号化コストを考慮せず、予測誤差の符号化コストのみを考慮して動きベクトル候補を検出する。動画像符号化装置23は、動き検出装置38で検出された動きベクトル候補を受け取って、その動きベクトル候補の周辺領域について動きベクトルの符号化コストまで考慮して動き検出を行う。すなわち、広い範囲でPMVを参照せずに動きを検出し、検出された動きベクトル候補の周辺領域についてPMVを参照して再度動き検出を行う。受け取った動きベクトル候補の周辺領域における再度の動き検出は2画素精度動き検出や単画素精度動き検出等任意の精度の動き検出段階で行うことが可能である。動画像符号化装置23では、この動きベクトル候補の周辺領域に加えて、コスト最小の動きベクトルが存在する可能性が高い他の領域、例えばPMVの周辺領域でも同時に動き検出を行っても良い。動き検出装置38は、動画像符号化装置23のMBパイプラインと無関係に動作するため、多くのサイクル数をかけて動き検出を行うことができる。   FIG. 23 shows a combination of a motion detection device 38 capable of detecting motion in a wide range and a moving image encoding device 23 including an MB pipeline to which the present invention is applied. The motion detection device 38 detects motion vector candidates in consideration of only the encoding cost of the prediction error without considering the encoding cost of the motion vector. The video encoding device 23 receives the motion vector candidate detected by the motion detection device 38 and performs motion detection in consideration of the motion vector encoding cost for the peripheral region of the motion vector candidate. That is, motion is detected without referring to the PMV over a wide range, and motion detection is performed again with reference to the PMV for the peripheral region of the detected motion vector candidate. The motion detection again in the peripheral region of the received motion vector candidate can be performed at a motion detection stage of any accuracy such as 2-pixel accuracy motion detection or single pixel accuracy motion detection. In the moving image encoding device 23, in addition to the peripheral region of the motion vector candidate, motion detection may be performed simultaneously in another region where there is a high possibility that a motion vector with the minimum cost exists, for example, the peripheral region of the PMV. Since the motion detection device 38 operates independently of the MB pipeline of the video encoding device 23, motion detection can be performed over many cycles.

また、動き検出装置38は、動画像符号化装置23で作成された再生画像ではなく、符号化されていない入力されたままの画像を対象として動き検出を行う構成とすることもできる。この構成とすることにより、動画像符号化装置23から動き検出装置38に再生画像を送る必要が無くなる。   In addition, the motion detection device 38 may be configured to perform motion detection on an input image that has not been encoded, but is not a reproduced image created by the video encoding device 23. With this configuration, it is not necessary to send a reproduced image from the moving image encoding device 23 to the motion detection device 38.

なお、動き検出装置38と動画像符号化装置23を同一のLSI上に集積することも可能である。この場合、動画像符号化装置23に接続されている外部メモリ4を動き検出装置38と動画像符号化装置23の共有メモリとし、動き検出装置38は再生画像を対象として動き検出を行う構成としても良い。   It is possible to integrate the motion detection device 38 and the moving image encoding device 23 on the same LSI. In this case, the external memory 4 connected to the video encoding device 23 is a shared memory of the motion detection device 38 and the video encoding device 23, and the motion detection device 38 performs motion detection on the reproduced image. Also good.

また、MPEG−2からH.264へトランスコードするときのように、既に検出された動きベクトルを利用できるときには、動き検出装置38を用いず、検出済の動きベクトルを直接動画像符号化装置23に入力し、この検出済み動きベクトルの周辺領域について動きベクトルの符号化コストまで考慮して動き検出を行う構成とすることもできる。   Also, MPEG-2 to H.264. When the already detected motion vector can be used as in the case of transcoding to H.264, the detected motion vector is directly input to the moving image encoding device 23 without using the motion detecting device 38, and this detected motion is detected. It is also possible to adopt a configuration in which motion detection is performed in consideration of the coding cost of the motion vector for the peripheral region of the vector.

2つの動画像符号化装置40、41と内部メモリ39を有する並列動画像符号化装置42のブロック図を図24に示す。図25は、動画像符号化装置40と41が符号化を分担するピクチャの領域を示す。i−MB行〜l−MB行、q−MB行〜t−MB行等を動画像符号化装置40が分担して符号化し、e−MB行〜h−MB行、m−MB行〜p−MB行等を動画像符号化装置41が分担して符号化する。このピクチャ分割方法によれば、動画像符号化装置40と41の分担するピクチャの領域が縦に連続しているため、両者の参照領域は縦に大きく重なっている。外部メモリ4から内部メモリ39へ2つの動画像符号化装置40と41の参照領域を転送し、内部メモリ39から個々の動画像符号化装置40と41に転送する構成とすれば、両者の参照領域の重なり部分を重複して転送する必要がないため、外部メモリ4と内部メモリ39の間のデータ転送量を削減することができる。   FIG. 24 shows a block diagram of a parallel video encoding device 42 having two video encoding devices 40 and 41 and an internal memory 39. FIG. 25 shows a picture area in which the video encoding devices 40 and 41 share the encoding. The moving image encoding device 40 divides and encodes i-MB line to l-MB line, q-MB line to t-MB line, etc., and e-MB line to h-MB line, m-MB line to p The video encoding device 41 shares MB rows and the like and encodes them. According to this picture division method, since the picture areas shared by the moving picture coding apparatuses 40 and 41 are vertically continuous, the reference areas of both are greatly overlapped vertically. If the configuration is such that the reference areas of the two moving image encoding devices 40 and 41 are transferred from the external memory 4 to the internal memory 39 and are transferred from the internal memory 39 to the individual moving image encoding devices 40 and 41, both references are made. Since there is no need to transfer the overlapping portions of the areas in an overlapping manner, the data transfer amount between the external memory 4 and the internal memory 39 can be reduced.

動画像符号化装置40と41に含まれるMBパイプラインの各ステージをMBが流れていく様子を図26に示す。各々の動画像符号化装置40と41のステージ構成は実施例1の動画像符号化装置と同一である。ただし、例えば、l−MB行に属するMBの再生画素と動きベクトルを動画像符号化装置40から動画像符号化装置41に転送し、m−MB行に属するMBの符号化で参照することが可能である。このように、動画像符号化装置40と41の分担する領域の境界において、上隣接MBと右上隣接MBにおける再生画素や動きベクトル等現MBの参照するデータを転送できるタイミングで動画像符号化装置40と41を動作させる。このように動作させることにより、従来のスライスインタリーブと異なり、本実施例の方法によれば、図25のi−MB行〜l−MB行やm−MB行〜p−MB行のように各動画像符号化装置40と41が分担して符号化する領域ごとにスライス分割する必要はなく、ピクチャ全体を1スライスとすることも可能である。更に、a−MB行〜d−MB行やe−MB行〜h−MB行等動画像符号化装置40と41が処理するピクチャの最初の領域が入力されると、動画像符号化装置40と41は符号化を開始することができるので、符号化遅延を抑えることができる。   FIG. 26 shows how the MB flows through each stage of the MB pipeline included in the moving image encoding devices 40 and 41. The moving image encoding devices 40 and 41 have the same stage configuration as the moving image encoding device of the first embodiment. However, for example, the reproduction pixel and motion vector of MB belonging to the l-MB row may be transferred from the moving image coding device 40 to the moving image coding device 41 and referred to in the coding of MB belonging to the m-MB row. Is possible. In this way, at the boundary between the regions shared by the moving image encoding devices 40 and 41, the moving image encoding device is at a timing at which data referred to by the current MB, such as reproduction pixels and motion vectors in the upper adjacent MB and the upper right adjacent MB, can be transferred. Operate 40 and 41. By operating in this way, unlike the conventional slice interleaving, according to the method of this embodiment, each of the i-MB line to l-MB line and the m-MB line to p-MB line in FIG. It is not necessary to divide the slice for each area to be encoded by the moving picture coding apparatuses 40 and 41, and the entire picture can be made into one slice. Further, when the first area of the picture to be processed by the moving image encoding devices 40 and 41 such as the a-MB row to the d-MB row and the e-MB row to the h-MB row is input, the moving image encoding device 40 is input. And 41 can start encoding, so that encoding delay can be suppressed.

なお、並列動画像符号化装置42は3個以上の動画像符号化装置を含んでいても良い。   The parallel video encoding device 42 may include three or more video encoding devices.

H.264では可変長符号化の方法としてCABACを用いることができる。CABACは、1個の算術符号化回路を使用して1つのスライスに含まれる全MBを連続的に処理する。一方、実施例1〜8に記載した発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。このため、本発明を用いる場合、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了した後でなければ2値化シンボルを算術符号化することができない。しかし、あるMBを符号化したとき、その発生符号量が著しく多い場合がある。このような場合、早急に量子化パラメータを大きくし、新たに符号化するMBから発生する符号量を減少させるようにレート制御しなければならない。本実施例では、実施例1〜8に記載した発明が適用された動画像符号化装置においてH.264で規定されるCABAC等の算術符号化を行う場合に、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行う方法を示す。   H. In H.264, CABAC can be used as a variable length coding method. CABAC continuously processes all MBs included in one slice using one arithmetic coding circuit. On the other hand, in the inventions described in the first to eighth embodiments, a plurality of vertically continuous MB rows are taken as a group, and one MB is selected per MB row from the group of MB rows. A plurality of MBs are continuously input to one MB pipeline. For this reason, when the present invention is used, a binary symbol cannot be arithmetically encoded unless encoding of all MBs included in a group of MBs that are vertically continuous is completed. However, when a certain MB is encoded, the generated code amount may be remarkably large. In such a case, it is necessary to increase the quantization parameter immediately and control the rate so as to reduce the amount of code generated from the newly encoded MB. In the present embodiment, the H.264 encoding apparatus to which the invention described in the first to eighth embodiments is applied. In the case of performing arithmetic coding such as CABAC defined by H.264, a method is shown in which rate control is performed before the coding of all MBs included in a group of MBs that are vertically continuous is completed.

背景技術の欄で説明したように、2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定する方法が提案されている(例えば、非特許文献6のp.20、図6参照)。この方法によって推定される発生符号量によってレート制御を行えば、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化終了を待たずにレート制御することができる。図27は、推定発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。   As described in the section of the background art, a method for estimating the generated code amount of arithmetic coding from the sum of the symbol lengths of binarized symbols has been proposed (for example, p.20 of Non-Patent Document 6, FIG. 6). reference). If rate control is performed based on the generated code amount estimated by this method, rate control can be performed without waiting for the completion of encoding of all MBs included in a group of MBs that are vertically continuous. FIG. 27 is a block diagram of a CABAC encoder that performs rate control based on the estimated generated code amount.

まず、シンタックスデータを2値化回路43により2値化する。2値化回路43は、ルックアップテーブルを含み、テーブルルックアップを用いて2値化シンボルへの変換を1サイクルで行う。そして、発生符号量推定回路44により変換された2値化シンボルのシンボル長の総和からMBごとの発生符号量を推定し、制御部22に推定発生符号量を送ってレート制御を行う。これにより、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行うことができる。   First, the syntax data is binarized by the binarization circuit 43. The binarization circuit 43 includes a look-up table, and performs conversion into a binarized symbol in one cycle using the table look-up. Then, the generated code amount for each MB is estimated from the sum of the symbol lengths of the binarized symbols converted by the generated code amount estimation circuit 44, and the estimated generated code amount is sent to the control unit 22 for rate control. As a result, rate control can be performed before the encoding of all MBs included in a group of MBs that are vertically continuous is completed.

ここで、本発明が適用された動画像符号化装置では、MB行の先頭のMBを処理するとき、その上に隣り合ったMB行の最後のMBの量子化パラメータはまだ求まっていない。しかし、量子化パラメータは直前に符号化したMBの量子化パラメータとの差分が2値化され、算術符号化される。そこで、MB行内の先頭のMBの量子化パラメータについては仮の値との差分(以下、仮mb_qp_deltaという。)を2値化するものとする。なお、仮の値は、既に符号化済みのMBの量子化パラメータを参照して上に隣り合うMB行内の最後のMBの量子化パラメータを推測して決定することが望ましい。一方、MB行内の先頭以外のMBの量子化パラメータは、H.264で規定されている通り、直前に符号化した左隣接MBのものとの差分(以下、mb_qp_deltaという。)を2値化する。   Here, in the moving picture encoding apparatus to which the present invention is applied, when the first MB of the MB row is processed, the quantization parameter of the last MB of the MB row adjacent to it is not yet determined. However, the difference between the quantization parameter and the quantization parameter of the MB encoded immediately before is binarized, and arithmetic coding is performed. Thus, the quantization parameter of the first MB in the MB row is binarized from the temporary value (hereinafter referred to as temporary mb_qp_delta). The provisional value is desirably determined by referring to the quantization parameter of the already encoded MB and estimating the quantization parameter of the last MB in the MB row adjacent above. On the other hand, the quantization parameters of MBs other than the head in the MB row are H.264. As defined in H.264, the difference (hereinafter referred to as mb_qp_delta) from the left adjacent MB encoded immediately before is binarized.

次に、2値化シンボルをいったん2値化シンボル記憶回路45で記憶し、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了した後、2値化シンボルを2値化シンボル記憶回路45から読み出す。そして、コンテクスト情報復元回路47を用いてそれに対応するコンテクスト情報を復元しながら、算術符号化回路46により算術符号化を行う。コンテクスト情報復元回路47の処理は、動画像復号装置で使用されるCABAC復号回路内のコンテクスト情報復元処理とほぼ同一である。コンテクスト情報復元回路47の処理フローを図28に示す。スライスの先頭でコンテクスト情報を初期化する(ステップS5)。次に、変数tmpをクリアし(ステップS6)、シンタックスデータの2値化シンボルを1個取得する(ステップS7)。その後、算術符号化するsymbolのコンテクスト情報を取得し(ステップS8)、2値化シンボル記憶回路45からsymbolを1ビット読み出す(ステップS9)。そして、コンテクスト情報とsymbolを算術符号化回路46に出力する(ステップS10)。変数tmpを1ビット左論理シフトした後、LSBにsymbolを連結する(ステップS11)。この新たなtmpがステップS7で取得した2値化シンボルと異なる場合にはステップS8に戻る(ステップS12)。tmpが2値化シンボルと一致する場合にはスライスの最後か否か判定し、スライスの最後でない場合にはステップS6に戻り(ステップS13)、tmpをクリアするとともに新たな2値化シンボルを取得する(ステップS6、S7)。スライスの最後である場合にはコンテクスト情報復元処理を終了する(ステップS13)。   Next, the binarized symbols are temporarily stored in the binarized symbol storage circuit 45, and after the encoding of all MBs included in a group of MBs that are vertically continuous is completed, the binarized symbols are binarized. Read out from the symbol storage circuit 45. Then, the arithmetic coding circuit 46 performs arithmetic coding while restoring the context information corresponding to the context information restoring circuit 47. The processing of the context information restoration circuit 47 is almost the same as the context information restoration processing in the CABAC decoding circuit used in the video decoding device. The processing flow of the context information restoration circuit 47 is shown in FIG. Context information is initialized at the head of the slice (step S5). Next, the variable tmp is cleared (step S6), and one binarized symbol of syntax data is acquired (step S7). Thereafter, the symbol context information to be arithmetically encoded is acquired (step S8), and 1 bit of symbol is read from the binarized symbol storage circuit 45 (step S9). Then, the context information and symbol are output to the arithmetic encoding circuit 46 (step S10). After the variable tmp is logically shifted by 1 bit to the left, symbol is connected to LSB (step S11). If the new tmp is different from the binarized symbol acquired in step S7, the process returns to step S8 (step S12). If tmp matches the binarized symbol, it is determined whether or not it is the end of the slice. If it is not the end of the slice, the process returns to step S6 (step S13) to clear tmp and obtain a new binarized symbol. (Steps S6 and S7). If it is the end of the slice, the context information restoration process is terminated (step S13).

ただし、MB行内の先頭のMBの仮mb_qp_deltaを2値化シンボル記憶回路45に記憶すると、上に隣り合うMB行内の最後のMBの量子化パラメータを再現し、それとの差分を算出して実際のmb_qp_deltaを求めた後、再度2値化し、算術符号化しなければならない。その際、全てのMBについてmb_qp_deltaを復号して量子化パラメータを再現することが必要となる。これを避けるために、MB行内の最後のMBについてはmb_qp_deltaとともに量子化パラメータそのものを2値化シンボル記憶回路45に記憶することとしても良い。MB行内の最後のMBの量子化パラメータを一定のビット長として記憶することにより、コンテクスト情報復元回路47でMB行内の最後のMBの量子化パラメータと識別することができる。   However, when the temporary mb_qp_delta of the first MB in the MB row is stored in the binarized symbol storage circuit 45, the quantization parameter of the last MB in the MB row adjacent above is reproduced, and the difference between the parameters is calculated and the actual MB After obtaining mb_qp_delta, it must be binarized again and arithmetically encoded. At that time, it is necessary to decode mb_qp_delta for all MBs and reproduce the quantization parameter. In order to avoid this, the quantization parameter itself may be stored in the binary symbol storage circuit 45 together with mb_qp_delta for the last MB in the MB row. By storing the quantization parameter of the last MB in the MB row as a constant bit length, the context information restoration circuit 47 can identify the quantization parameter of the last MB in the MB row.

なお、2値化シンボル記憶回路45は動画像符号化装置内部に無くても良く、外部メモリ4に2値化シンボルを記憶することとしても良い。   Note that the binarized symbol storage circuit 45 may not be provided in the moving image encoding apparatus, and the binarized symbols may be stored in the external memory 4.

本実施例の方法には、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができるという利点がある。特に、2値化シンボル記憶回路45にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路46にIピクチャの2値化シンボル発生量を処理できるだけの性能を持たせる必要はなく、複数ピクチャの2値化シンボルの平均発生量を処理できるだけの性能を持たせれば足りるという利点がある。   The method of this embodiment has an advantage that arithmetic coding can be performed even if the arithmetic coding circuit does not have a performance sufficient to process a binarized symbol generation amount that suddenly increases. In particular, if the binarized symbol storage circuit 45 has a sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the arithmetic coding circuit 46 is provided. There is an advantage that it is not necessary to have a performance sufficient to process the binarized symbol generation amount of an I picture, and it is sufficient to have a performance sufficient to process an average generation amount of binarized symbols of a plurality of pictures.

本実施例では、CABACを用いる動画像符号化装置に本発明を適用する場合における実施例9とは別のレート制御方法を示す。図29は、仮の発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。2値化シンボルをいったん2値化シンボル記憶回路45に記憶し、2値化シンボル記憶回路45から読み出してそれに対応するコンテクスト情報を復元しながら算術符号化(以下、真の算術符号化という。)を行う点については実施例9と同じである。本実施例では、2値化シンボルを仮算術符号化回路48により仮算術符号化して仮の発生符号量を算出し、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前に仮の発生符号量に基づいてレート制御する点が異なる。   In the present embodiment, a rate control method different from that of the ninth embodiment in the case where the present invention is applied to a moving picture coding apparatus using CABAC is shown. FIG. 29 is a block diagram of a CABAC encoder that performs rate control based on a provisional generated code amount. The binary symbol is temporarily stored in the binary symbol storage circuit 45, and is read out from the binary symbol storage circuit 45 to perform arithmetic coding while restoring the corresponding context information (hereinafter referred to as true arithmetic coding). This is the same as in the ninth embodiment. In the present embodiment, the binary symbols are provisionally arithmetically encoded by the provisional arithmetic encoding circuit 48 to calculate a provisional generated code amount, and all the MBs included in a group of MB rows that are vertically continuous are encoded. The difference is that the rate is controlled based on the provisional generated code amount before the end.

MB行内の先頭のMBでは、通常上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行う。しかし、本発明では縦に連続する複数のMB行をひとまとまりとして符号化を進めるため、MB行内の先頭のMBを符号化するとき上に隣り合うMB行内の最後のMBは符号化が終わっていない。このため、縦に連続するひとまとまりのMB行の符号化が終了するまで、上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行うことができない。そこで、MB行内の先頭のMBについては仮のrange、low、および確率テーブルに仮の値を設定して仮算術符号化を開始する。   In the first MB in the MB row, arithmetic coding is performed by taking over the range, low, and probability table when the arithmetic coding of the last MB in the adjacent MB row is finished. However, in the present invention, since encoding is performed with a plurality of vertically continuous MB rows as a group, when the first MB in the MB row is encoded, the last MB in the adjacent MB row is already encoded. Absent. For this reason, until encoding of a group of consecutive MB rows is completed, the arithmetic is performed by taking over the range, low, and probability table when the arithmetic encoding of the last MB in the adjacent MB row is finished. Encoding cannot be performed. Therefore, for the first MB in the MB row, provisional values are set in the provisional range, low, and probability table, and provisional arithmetic coding is started.

縦に連続する4つのMB行をひとまとまりとして符号化を行う場合の仮算術符号化回路48のブロック図を図30に示す。コンテクスト計算部分49はsymbolごとにコンテキスト計算を行う。rangeを記憶する部分51〜54、lowを記憶する部分55〜58、および確率テーブル59〜62は4つのMB行に対応して4個づつ存在する。range(n)記憶部分51、low(n)記憶部分55、および確率テーブル(n)59は4つのMB行のうち最も上のMB行に対応する。range(n+1)記憶部分52、low(n+1)記憶部分56、および確率テーブル(n+1)60は上から2番目のMB行に対応する。そして、range(n+2)記憶部分53、low(n+2)記憶部分57、および確率テーブル(n+2)61は上から3番目のMB行に対応し、range(n+3)記憶部分54、low(n+3)記憶部分58、および確率テーブル(n+3)62は最も下のMB行に対応する。rangeを記憶する部分51〜54とlowを記憶する部分55〜58の内容は、4つのMB行に含まれる個々のMBの算術符号化を開始するときのみ算術符号化部分50に読み込まれ、そのMBの算術符号化を終了するとき算術符号化部分50から書き込まれ更新される。   FIG. 30 shows a block diagram of the provisional arithmetic encoding circuit 48 in the case where encoding is performed with a group of four consecutive MB rows as a group. The context calculation part 49 performs context calculation for each symbol. There are four portions 51 to 54 for storing a range, portions 55 to 58 for storing a low, and probability tables 59 to 62 corresponding to four MB rows. The range (n) storage portion 51, the low (n) storage portion 55, and the probability table (n) 59 correspond to the uppermost MB row of the four MB rows. The range (n + 1) storage portion 52, the low (n + 1) storage portion 56, and the probability table (n + 1) 60 correspond to the second MB row from the top. The range (n + 2) storage portion 53, the low (n + 2) storage portion 57, and the probability table (n + 2) 61 correspond to the third MB row from the top, the range (n + 3) storage portion 54, and the low (n + 3) storage. Portion 58 and probability table (n + 3) 62 correspond to the bottom MB row. The contents of the parts 51 to 54 for storing the range and the parts 55 to 58 for storing the low are read into the arithmetic encoding part 50 only when the arithmetic encoding of the individual MBs included in the four MB rows is started. When the arithmetic encoding of the MB is finished, it is written and updated from the arithmetic encoding portion 50.

MB行内の先頭のMBについて仮のrange、low、および確率テーブルを設定する方法として3つ考えられる。最初の方法は、H.264で規定されている初期化を行う方法である。H.264ではスライスの先頭でrange、low、および確率テーブルを初期化する。MB行内の先頭のMBについて仮算術符号化を開始するとき、この初期化を行う。   There are three possible methods for setting a temporary range, low, and probability table for the first MB in the MB row. The first method is described in H.W. This is a method of performing initialization defined in H.264. H. H.264 initializes the range, low, and probability tables at the beginning of the slice. This initialization is performed when provisional arithmetic coding is started for the first MB in the MB row.

2番目の方法は、縦に連続するひとまとまりのMB行内の個々のMB行ごとに、MB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを、その下に隣接するひとまとまりのMB行内の対応するMB行における先頭MBに引き継ぐ方法である。縦に連続する4つのMB行をひとまとまりとして符号化を行う場合を図31に示す。図31は12のMB行で構成されるピクチャを示す。ピクチャの最も上のひとまとまりの4つのMB行については、個々のMB行内の最初のMBのrange、low、および確率テーブルはH.264で規定されている方法で初期化する。上から2番目のひとまとまりの4つのMB行に含まれる個々のMB行については、最も上のひとまとまりの4つのMB行に含まれる個々のMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継ぐ。同様に、上から3番目のひとまとまりの4つのMB行については、上から2番目のひとまとまりの4つのMB行に含まれる個々のMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継ぐ。   In the second method, the range, low, and probability tables when the last MB in the MB row has been arithmetically encoded for each MB row in a group of vertically contiguous MB rows are This is a method of taking over to the first MB in a corresponding MB row in a group of adjacent MBs. FIG. 31 shows a case where encoding is performed with a group of four vertically continuous MB rows. FIG. 31 shows a picture composed of 12 MB rows. For the top four batches of MB in the picture, the range, low, and probability table of the first MB in each MB row is H.264. It is initialized by the method specified in H.264. For the individual MB rows included in the four MB rows in the second batch from the top, the arithmetic encoding of the last MB in the individual MB rows included in the uppermost four MB rows has been completed. Take over the time range, low, and probability table. Similarly, for the 4 MB rows in the third batch from the top, the arithmetic encoding of the last MB in each MB row included in the 4 MB rows in the second batch from the top is finished. Take over the range, low, and probability tables.

3番目の方法は、既に真の算術符号化を終了したピクチャの同じ位置にあるMBが引き継いだrange、low、および確率テーブルと同じものを、MB行内の先頭のMBにおける仮のrange、low、および確率テーブルとして設定する方法である。   The third method is the same as the range, low, and probability table inherited by the MB at the same position in the picture that has already been subjected to true arithmetic coding, and the temporary range, low, And setting as a probability table.

あるMBを符号化しているとき2値化シンボルが突発的に増加し、仮算術符号化回路48の処理能力を超えたときは、そのMBについては途中で仮算術符号化を打ち切り、次のMBの仮算術符号化を開始しても良い。2値化シンボルの発生量が急激に増大した場合には、実施例9と同様に2値化シンボルの発生量により発生符号量を推定し、これから符号化するMBの量子化パラメータを大きくし、2値化シンボルの発生量を減少させる等の方法によりレート制御を行うことができる。このため、突発的に発生する2値化シンボルの最大発生量を処理できるだけの性能を仮算術符号化回路48に持たせる必要はない。また、本実施例の方法でも、実施例9の方法同様、2値化シンボル記憶回路45に十分な記憶容量を持たせれば、真の算術符号化回路46に複数ピクチャの2値化シンボルの平均発生量を処理できるだけの性能を持たせれば足りるという利点がある。   When a certain MB is encoded, the binarized symbols suddenly increase, and when the processing capacity of the provisional arithmetic encoding circuit 48 is exceeded, provisional arithmetic encoding is aborted on the way to the next MB. The provisional arithmetic coding may be started. When the generation amount of binarized symbols increases rapidly, the generated code amount is estimated from the generation amount of binarized symbols as in the ninth embodiment, and the quantization parameter of the MB to be encoded is increased from now on, Rate control can be performed by a method such as reducing the generation amount of binarized symbols. For this reason, it is not necessary to give the provisional arithmetic coding circuit 48 sufficient performance to handle the maximum amount of binarized symbols that occur unexpectedly. Also in the method of the present embodiment, as in the method of the ninth embodiment, if the binarized symbol storage circuit 45 has a sufficient storage capacity, the true arithmetic coding circuit 46 can average the binarized symbols of a plurality of pictures. There is an advantage that it is sufficient to have performance sufficient to process the generated amount.

仮算術符号化回路48を複数設けることもできる。図32は、2並列で仮算術符号化を行う場合の仮算術符号化回路68のブロック図である。コンテクスト計算部分49と算術符号化部分50を2個づつ有する。一方の算術符号化部分50には、range(n)記憶部分51、low(n)記憶部分55、確率テーブル(n)59、range(n+2)記憶部分53、low(n+2)記憶部分57、および確率テーブル(n+2)61が接続されており、ひとまとまりの4つのMB行のうち最も上のMB行と上から3番目のMB行に含まれるMBを仮算術符号化する。また、もうひとつの算術符号化部分50には、range(n+1)記憶部分52、low(n+1)記憶部分56、確率テーブル(n+1)60、range(n+3)記憶部分54、low(n+3)記憶部分58、および確率テーブル(n+3)62が接続されており、ひとまとまりの4つのMB行のうち上から2番目のMB行と最も下のMB行に含まれるMBを仮算術符号化する。実施例1と類似したMBパイプラインのステージ構成において、図1中のe行10列、f行8列、g行6列、h行4列のMBが各ステージを流れていく様子を図33に示す。このように、2並列で仮算術符号化を行うことにより、1つのMBの仮算術符号化を2MBサイクルかけて行うことができる。なお、図32中のメモリ63、65とメモリ64、66はそれぞれ2値化シンボルとシンタックッスデータを2MBサイクル保持するために設けられている。   A plurality of provisional arithmetic encoding circuits 48 may be provided. FIG. 32 is a block diagram of the provisional arithmetic coding circuit 68 when provisional arithmetic coding is performed in two parallel. Two context calculation parts 49 and two arithmetic coding parts 50 are provided. One arithmetic encoding portion 50 includes a range (n) storage portion 51, a low (n) storage portion 55, a probability table (n) 59, a range (n + 2) storage portion 53, a low (n + 2) storage portion 57, and A probability table (n + 2) 61 is connected, and provisional arithmetic coding is performed on the MBs included in the uppermost MB row and the third MB row from the top among a group of four MB rows. The other arithmetic coding part 50 includes a range (n + 1) storage part 52, a low (n + 1) storage part 56, a probability table (n + 1) 60, a range (n + 3) storage part 54, and a low (n + 3) storage part. 58 and a probability table (n + 3) 62 are connected, and provisional arithmetic coding is performed on the MBs included in the second MB row from the top and the lowest MB row among a group of four MB rows. In the MB pipeline stage configuration similar to that of the first embodiment, a state in which the MB of e row 10 column, f row 8 column, g row 6 column, and h row 4 column in FIG. Shown in Thus, by performing provisional arithmetic coding in two parallels, provisional arithmetic coding of one MB can be performed over 2 MB cycles. Note that the memories 63 and 65 and the memories 64 and 66 in FIG. 32 are provided to hold binary symbols and syntax data, respectively, for 2 MB cycles.

実施例9の方法は、直前の符号化済みピクチャの2 値化シンボル長と発生符号量との比率αが必要である。このため、シーンチェンジ等があった場合、発生符号量の推定が不正確となる。一方、本実施例の方法は、同一MB行内のMBの算術符号化が行われるにつれて仮算術符号化に用いられる確率テーブルの値が正確なものに収束する。このため、シーンチェンジ等があった場合でも真の算術符号化による発生符号量に基づくレート制御に近いレート制御を行うことができる。   The method of the ninth embodiment requires a ratio α between the binary symbol length of the immediately previous encoded picture and the generated code amount. For this reason, when there is a scene change or the like, the estimation of the generated code amount becomes inaccurate. On the other hand, according to the method of the present embodiment, as the arithmetic coding of MBs in the same MB row is performed, the value of the probability table used for provisional arithmetic coding converges to an accurate one. For this reason, even when there is a scene change or the like, it is possible to perform rate control close to rate control based on the generated code amount by true arithmetic coding.

シンタックスデータを2値化以外の方法で圧縮していったん記憶した後、シンタックスデータを復元して2値化、算術符号化することもできる。例えば、H.264ではCABACの他にCAVLCも可変長符号化方式として規定されているが、CAVLCは1個のシンタックスデータを1CKで可変長符号化することができる。CAVLCで圧縮する場合のCABAC符号化器のブロック図を図34に示す。シンタックスデータをCAVLC符号化回路69で圧縮して発生したCAVLC符号化ビットストリームをCAVLC符号化ビットストリーム記憶回路70にいったん記憶する。そして、CAVLC符号化ビットストリーム記憶回路70から読み出したCAVLC符号化ビットストリームをCAVLC復号回路71で復号し、復元されたシンタックスデータを2値化回路43により2値化し、算術符号化回路46により算術符号化する。なお、図34には、仮算術符号化を行い、仮発生符号量でレート制御する場合を示したが、実施例9で示したように、2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定し、レート制御しても良い。   After the syntax data is compressed by a method other than binarization and temporarily stored, the syntax data can be restored and binarized or arithmetically encoded. For example, H.M. In H.264, in addition to CABAC, CAVLC is defined as a variable-length encoding method, but CAVLC can variable-code one piece of syntax data with 1 CK. FIG. 34 shows a block diagram of a CABAC encoder when compressed by CAVLC. The CAVLC encoded bit stream generated by compressing the syntax data by the CAVLC encoding circuit 69 is temporarily stored in the CAVLC encoded bit stream storage circuit 70. Then, the CAVLC encoded bit stream read from the CAVLC encoded bit stream storage circuit 70 is decoded by the CAVLC decoding circuit 71, the restored syntax data is binarized by the binarizing circuit 43, and the arithmetic encoding circuit 46 Perform arithmetic coding. FIG. 34 shows a case where provisional arithmetic coding is performed and rate control is performed using the temporarily generated code amount. As shown in the ninth embodiment, arithmetic coding is performed based on the sum of the symbol lengths of the binarized symbols. The amount of generated codes may be estimated and the rate may be controlled.

ここで、実施例9で指摘したように、本発明が適用された動画像符号化装置では、MB行の先頭のMBを処理するとき、その上に隣り合ったMB行の最後のMBの量子化パラメータはまだ求まっていない。そこで、実施例9と同様に、MB行内の先頭のMBの量子化パラメータについては仮の値との差分(以下、仮mb_qp_deltaという。)をCAVLCで符号化し、MB行内の先頭以外のMBの量子化パラメータは直前に符号化した左隣接MBのものとの差分(以下、mb_qp_deltaという。)をCAVLCで符号化するものとする。そして、MB行内の先頭のMBの量子化パラメータについては、上隣接MB行内の最後のMBの量子化パラメータを再現し、それとの差分を算出して実際のmb_qp_deltaを求めた後、2値化し、算術符号化する。その際、全てのMBについてmb_qp_deltaを復号して量子化パラメータを再現することを避けるために、MB行内の最後のMBについてmb_qp_deltaとともに量子化パラメータそのものをCAVLC符号化ビットストリーム記憶回路70に記憶することとしても良い。   Here, as pointed out in the ninth embodiment, in the moving picture encoding apparatus to which the present invention is applied, when the first MB of the MB row is processed, the quantum of the last MB of the adjacent MB row is further processed. The parameter has not yet been determined. Thus, as in the ninth embodiment, the quantization parameter of the first MB in the MB row is encoded with a difference from the temporary value (hereinafter referred to as temporary mb_qp_delta) by CAVLC, and the quantum of the MB other than the first MB in the MB row. The encoding parameter is obtained by encoding the difference (hereinafter referred to as mb_qp_delta) with that of the left adjacent MB encoded immediately before by CAVLC. Then, with respect to the quantization parameter of the first MB in the MB row, the quantization parameter of the last MB in the upper adjacent MB row is reproduced, and the difference between them is calculated to obtain the actual mb_qp_delta, and then binarized. Perform arithmetic coding. At that time, in order to avoid decoding mb_qp_delta for all MBs and reproducing the quantization parameter, the quantization parameter itself is stored in the CAVLC encoded bitstream storage circuit 70 together with mb_qp_delta for the last MB in the MB row. It is also good.

シンタックスデータを圧縮し、復元できる可逆圧縮方法であれば、CAVLC以外の方法を用いることもできる。すなわち、シンタックスデータを可逆圧縮して圧縮されたシンタックスデータをいったん記憶する。そして、この圧縮されたシンタックスデータを読み出してシンタックスデータを復元する。この復元されたシンタックスデータを2値化シンボルに変換し、算術符号化する。   Any method other than CAVLC can be used as long as it is a reversible compression method capable of compressing and restoring syntax data. That is, syntax data compressed by lossless compression of syntax data is temporarily stored. Then, the compressed syntax data is read to restore the syntax data. The restored syntax data is converted into a binary symbol and arithmetically encoded.

H.264では、entropy_coding_mode_flagを指定することにより、ピクチャごとにCAVLCとCABACを切り替えることができる。そこで、可逆圧縮方法としてCAVLCを用いる場合には、あるMBの2値化シンボルの発生量が突発的に増加し、仮算術符号化した結果真の算術符号化回路46の処理能力を超えると予測されるとき、そのMBを含むピクチャ全体をCAVLC符号化し、一方、仮算術符号化した結果真の算術符号化回路46で処理できると予測されるとき、そのMBを含むピクチャ全体をCABAC符号化することができる。これにより、真の算術符号化回路46の性能が不測するという状況を確実に回避できる。   H. In H.264, CAVLC and CABAC can be switched for each picture by specifying entropy_coding_mode_flag. Therefore, when CAVLC is used as the lossless compression method, the amount of binarized symbols generated for a certain MB suddenly increases, and it is predicted that the processing capacity of the true arithmetic encoding circuit 46 will be exceeded as a result of provisional arithmetic encoding. The entire picture including the MB is CAVLC encoded, and when the result of provisional arithmetic encoding is predicted to be processed by the true arithmetic encoding circuit 46, the entire picture including the MB is CABAC encoded. be able to. As a result, a situation in which the performance of the true arithmetic coding circuit 46 is unexpected can be surely avoided.

また、CAVLC符号化回路69でCAVLC符号化ビットストリームの符号量を算出し、CAVLC符号化と仮算術符号化の仮発生符号量を比較して、ピクチャごとに発生符号量が少ないと推測されるエントロピー符号化モードを選択することもできる。   Further, the CAVLC encoding circuit 69 calculates the code amount of the CAVLC encoded bit stream, and compares the CAVLC encoding and the provisional generated code amount of the provisional arithmetic encoding, and it is estimated that the generated code amount is small for each picture. An entropy coding mode can also be selected.

本実施例では、実施例8で示した2つの動画像符号化装置40と41で構成される並列動画像符号化装置42からCABACで符号化された1本のビットストリームを生成する方法を示す。動画像符号化装置40と41から2値化シンボルが出力される並列動画像符号化装置のブロック図を図35に示す。動画像符号化装置40と41から出力される2値化シンボルを共通の2値化シンボル記憶回路45にいったん記憶する。そして、2値化シンボルを2値化シンボル記憶回路45から読み出し、コンテクスト情報復元回路47を用いてそれに対応するコンテクスト情報を復元しながら、算術符号化回路46により算術符号化を行う。   In the present embodiment, a method of generating one bit stream encoded by CABAC from the parallel moving image encoding device 42 including the two moving image encoding devices 40 and 41 described in the eighth embodiment will be described. . FIG. 35 shows a block diagram of a parallel moving image encoding device in which binarized symbols are output from the moving image encoding devices 40 and 41. The binarized symbols output from the moving image encoding devices 40 and 41 are temporarily stored in the common binarized symbol storage circuit 45. Then, the binary encoding symbol is read from the binary symbol storage circuit 45, and the arithmetic encoding circuit 46 performs arithmetic encoding while recovering the corresponding context information using the context information recovery circuit 47.

また、動画像符号化装置40と41からCAVLC符号化ビットストリームが出力される並列動画像符号化装置のブロック図を図36に示す。動画像符号化装置40と41から出力されるCAVLC符号化ビットストリームを共通のCAVLC符号化ビットストリーム記憶回路70にいったん記憶する。そして、CAVLC符号化ビットストリームをCAVLC符号化ビットストリーム記憶回路70から読み出し、CAVLC復号回路71により復号してシンタックスデータに戻した後、そのシンタックスデータを2値化し、算術符号化を行う。   FIG. 36 shows a block diagram of a parallel moving image encoding apparatus in which a CAVLC encoded bit stream is output from the moving image encoding apparatuses 40 and 41. The CAVLC encoded bit stream output from the moving image encoding devices 40 and 41 is temporarily stored in the common CAVLC encoded bit stream storage circuit 70. Then, the CAVLC encoded bit stream is read from the CAVLC encoded bit stream storage circuit 70, decoded by the CAVLC decoding circuit 71 and returned to syntax data, and then the syntax data is binarized and subjected to arithmetic encoding.

なお、並列動画像符号化装置42は3個以上の動画像符号化装置を含んでいても良い。   The parallel video encoding device 42 may include three or more video encoding devices.

H.264のMBAFF(Macroblock Adaptive Frame Field Coding)では、縦に隣接する2つのMBをペア(以下、MBペアという。)とし、16画素×32ラインごとにフィールド符号化とフレーム符号化を切り替えて符号化する。フィールド符号化とフレーム符号化のときのMBペアを図37に示す。図37(a)はフィールド符号化のときのMBペアである。32ラインの画素のうち、奇数ラインでトップフィールドMB72を構成し、偶数ラインでボトムフィールドMB73を構成する。また、図37(b)はフレーム符号化のときのMBペアである。32ラインのうち、上半分の16ラインで上フレームMB74を構成し、下半分の16ラインで下フレームMB75を構成する。トップフィールドMB72とボトムフィールドMB73はお互いに隣接MBの関係にないが、上フレームMB74は下フレームMB75に対して上隣接MBの関係にある。このため、フレーム符号化が選択された場合、下フレームMB75のPMVは上フレームMB74のイントラ/インター判定結果を考慮して決定しなければならないという制限がある。また、下フレームMB75のイントラ予測は上フレームMB74の再生画素を用いるため、上フレームMB74について動き補償が行われ、再生画素が作成されなければ、下フレームMB75についてイントラ予測を行うことができないという制限がある。   H. In H.264 MBAFF (Macroblock Adaptive Frame Field Coding), two vertically adjacent MBs are paired (hereinafter referred to as MB pairs), and encoding is performed by switching between field encoding and frame encoding every 16 pixels × 32 lines. To do. An MB pair at the time of field coding and frame coding is shown in FIG. FIG. 37A shows an MB pair at the time of field coding. Of the 32 lines of pixels, odd lines constitute the top field MB72 and even lines constitute the bottom field MB73. FIG. 37B shows an MB pair at the time of frame coding. Of the 32 lines, the upper half 16 lines constitute the upper frame MB74, and the lower half 16 lines constitute the lower frame MB75. The top field MB72 and the bottom field MB73 are not in the relationship of the adjacent MB to each other, but the upper frame MB74 is in the relationship of the upper adjacent MB to the lower frame MB75. For this reason, when frame coding is selected, there is a limitation that the PMV of the lower frame MB75 must be determined in consideration of the intra / inter determination result of the upper frame MB74. In addition, since intra-prediction of the lower frame MB75 uses the reconstructed pixel of the upper frame MB74, if the motion compensation is performed for the upper frame MB74 and the reconstructed pixel is not created, the intra-prediction cannot be performed for the lower frame MB75. There is.

現MBペアと左隣接MBペアの両方ともフィールド符号化またはフレーム符号化が選択されている場合、現MBペアに含まれる各々のMBの左隣接MBはその左隣りに位置するMBのみである。しかし、現MBペアと左隣接MBペアのフィールド符号化/フレーム符号化の選択が異なる場合、左隣接MBペアに含まれる両方のMBが現MBペアに含まれる個々のMBの左隣接MBとなる。現MBペアはフィールド符号化が選択され、左隣接MBペアはフレーム符号化が選択された場合を図38(a)に示す。トップフィールドMB72の左隣接MBには左隣接MBペアに含まれる上フレームMBの奇数ライン76と下フレームMBの奇数ライン77が対応し、ボトムフィールドMB73の左隣接MBには、上フレームMBの偶数ラインと下フレームMBの偶数ラインが対応する。また、現MBペアはフレーム符号化が選択され、左隣接MBペアはフィールド符号化が選択された場合を図38(b)に示す。上フレームMB74の左隣接MBにはトップフィールドMBの上半分16ライン78とボトムフィールドMBの上半分16ライン79が対応し、下フレームMB75の左隣接MBにはトップフィールドMBの下半分16ラインとボトムフィールドMBの下半分16ラインが対応する。このため、左隣接MBペアに含まれる両方のMBについて動き補償が行われ、再生画素が算出されなければ、現MBペアについてイントラ予測を行うことができないという制限がある。   When field coding or frame coding is selected for both the current MB pair and the left adjacent MB pair, the left adjacent MB of each MB included in the current MB pair is only the MB located on the left side. However, when the field encoding / frame encoding selection of the current MB pair and the left adjacent MB pair is different, both MBs included in the left adjacent MB pair are left adjacent MBs of individual MBs included in the current MB pair. . FIG. 38A shows a case where field encoding is selected for the current MB pair and frame encoding is selected for the left adjacent MB pair. The odd line 76 of the upper frame MB and the odd line 77 of the lower frame MB included in the left adjacent MB pair correspond to the left adjacent MB of the top field MB72, and the even number of the upper frame MB corresponds to the left adjacent MB of the bottom field MB73. A line corresponds to an even line of the lower frame MB. Further, FIG. 38B shows a case where frame coding is selected for the current MB pair and field coding is selected for the left adjacent MB pair. The upper half 16 lines 78 of the top field MB and the upper half 16 lines 79 of the bottom field MB correspond to the left adjacent MB of the upper frame MB74, and the lower half 16 lines of the top field MB correspond to the left adjacent MB of the lower frame MB75. The lower half 16 lines of the bottom field MB correspond. For this reason, if motion compensation is performed for both MBs included in the left adjacent MB pair and the reproduced pixel is not calculated, intra prediction cannot be performed for the current MB pair.

本実施例では、MBAFFの場合に、縦に連続する8のMB行をひとまとまりとして、これらひとまとまりのMB行から、縦に連続する2つのMB行当たり1つのMBペアを選択し、これら選択された4個のMBペアを1個のMBパイプラインに投入する例を示す。図39は、本発明が適用されるMBペアの1例を示す図である。ピクチャは図7のものと同一であるが、上述した通りMBAFFではMBペアがフィールド符号化されるかフレーム符号化されるかにより、2つのMBへのラインの割り当てが異なる。そこで、英字の大文字を用いてMBペアを構成するMBを示す。フィールド符号化のときは、I15、K13、M11、O9等はトップフィールドMB72であり、J15、L13、N11、P9等はボトムフィールドMB73である。また、フレーム符号化のときは、I15、K13、M11、O9等は上フレームMB74であり、J15、L13、N11、P9等は下フレームMB75である。   In the present embodiment, in the case of MBAFF, eight MB rows that are vertically continuous are taken as a group, and one MB pair is selected from these batch of MB rows per two MB rows that are vertically continuous. An example will be shown in which the four MB pairs are input to one MB pipeline. FIG. 39 is a diagram showing an example of an MB pair to which the present invention is applied. The picture is the same as that shown in FIG. 7, but as described above, in MBAFF, line assignment to two MBs differs depending on whether the MB pair is field-coded or frame-coded. Therefore, an MB that constitutes an MB pair is shown using uppercase letters. In the field coding, I15, K13, M11, O9, etc. are the top field MB72, and J15, L13, N11, P9, etc. are the bottom field MB73. In frame encoding, I15, K13, M11, O9, etc. are the upper frame MB74, and J15, L13, N11, P9, etc. are the lower frame MB75.

図40は本発明が適用される動画像符号化装置のブロック図を示す。MBペア選択回路81は、例えば、図39に示すようにi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとし、i−MB行とj−MB行に属するMBペアについては、左下隣接MBペアがまだ選択されていないMBペアを選択し、かつ、k−MB行とl−MB行、m−MB行とn−MB行、o−MB行とp−MB行に属するMBペアについては、右上隣接MBペアが既に選択されているMBペアを選択することによって、I15−J15、K13−L13、M11−N11、O9−P9のMBペアを選択する。フィールドMBペア/フレームMBペア構成回路82は、フィールド符号化が選択されたときは、MBペアの奇数ラインでトップフィールドMB72を構成し、MBペアの偶数ラインでボトムフィールドMB73を構成する。一方、フレーム符号化が選択されたときは、MBペアの上半分のラインで上フレームMB74を構成し、MBペアの下半分のラインで下フレームMB75を構成する。符号化データ設定回路83は、フィールド符号化が選択されたとき、最初に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。そして、2回目にI15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる残りの片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。また、フレーム符号化が選択されたとき、I15MB、K13MB、M11MB、O9MB、J15MB、L13MB、N11MB、P9MBの順番で、1マクロブロックサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。MBペア選択回路81によって選択された最後のMBを符号化するために必要なデータがMBパイプライン80に設定され、そのMBがMBパイプライン80に投入されると、MBペア選択回路81は、I16−J16、K14−L14、M12−N12、O10−P10のMBペアを新たに選択する。   FIG. 40 is a block diagram of a moving picture encoding apparatus to which the present invention is applied. For example, as shown in FIG. 39, the MB pair selection circuit 81 includes an i-MB row, a j-MB row, a k-MB row, an l-MB row, an m-MB row, an n-MB row, an o-MB row, For the MB pairs belonging to the p-MB rows and belonging to the i-MB rows and the j-MB rows, the MB pairs for which the lower left neighboring MB pair has not yet been selected are selected, and the k-MB rows and the l- For MB pairs belonging to the MB row, the m-MB row and the n-MB row, the o-MB row and the p-MB row, by selecting the MB pair in which the upper right adjacent MB pair has already been selected, I15-J15 , K13-L13, M11-N11, O9-P9 MB pairs are selected. When field encoding is selected, the field MB pair / frame MB pair configuration circuit 82 configures the top field MB72 with the odd lines of the MB pair and configures the bottom field MB73 with the even lines of the MB pair. On the other hand, when frame coding is selected, the upper frame MB74 is configured by the upper half line of the MB pair, and the lower frame MB75 is configured by the lower half line of the MB pair. When field encoding is selected, the encoded data setting circuit 83 first takes 4 MB cycles for one of the MBs included in the MB pairs of I15-J15, K13-L13, M11-N11, and O9-P9. In order, data necessary for encoding individual MBs every 1 MB cycle is set in the MB pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. Then, for the remaining one MB included in the MB pair of I15-J15, K13-L13, M11-N11, and O9-P9 for the second time, individual MBs are encoded every 1 MB cycle in order over 4 MB cycles. Data necessary for this is set in the MB pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When frame encoding is selected, the data necessary for encoding each MB in each macroblock cycle in the order of I15MB, K13MB, M11MB, O9MB, J15MB, L13MB, N11MB, and P9MB Set to pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When the data necessary for encoding the last MB selected by the MB pair selection circuit 81 is set in the MB pipeline 80 and the MB is input to the MB pipeline 80, the MB pair selection circuit 81 The MB pair of I16-J16, K14-L14, M12-N12, and O10-P10 is newly selected.

図41は本発明が適用される動画像符号化方法の処理のフローチャートを示す。例えば、図39に示すようにi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとし、i−MB行とj−MB行に属するMBペアについては、左下隣接MBペアがまだ選択されていないMBペアを選択し、かつ、k−MB行とl−MB行、m−MB行とn−MB行、o−MB行とp−MB行に属するMBペアについては、右上隣接MBペアが既に選択されているMBペアを選択することによって、I15−J15、K13−L13、M11−N11、O9−P9のMBペアが選択される(ステップS14)。次に、フィールド符号化が選択されたときは、MBペアの奇数ラインでトップフィールドMB72が構成され、MBペアの偶数ラインでボトムフィールドMB73が構成される。一方、フレーム符号化が選択されたときは、MBペアの上半分のラインで上フレームMB74が構成され、MBペアの下半分のラインで下フレームMB75が構成される(ステップS15、ステップS16、ステップS23)。そして、フィールド符号化が選択されたとき、最初に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS17、ステップS18、ステップS19)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。次に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる残りの片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS20、ステップS21、ステップS22)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。また、フレーム符号化が選択されたとき、I15MB、K13MB、M11MB、O9MB、J15MB、L13MB、N11MB、P9MBの順番で、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS24、ステップS25、ステップS26、ステップS27、ステップS28、ステップS29)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。選択された最後のMBを符号化するために必要なデータがMBパイプライン80に設定され、そのMBがMBパイプライン80に投入されると、ステップS14に戻り(ステップS21、ステップS28)、I16−J16、K14−L14、M12−N12、O10−P10のMBペアが新たに選択される(ステップS14)。   FIG. 41 shows a flowchart of the process of the moving picture coding method to which the present invention is applied. For example, as shown in FIG. 39, i-MB line, j-MB line, k-MB line, l-MB line, m-MB line, n-MB line, o-MB line, and p-MB line are grouped. For the MB pairs belonging to the i-MB row and the j-MB row, the MB pair for which the lower left adjacent MB pair has not yet been selected is selected, and the k-MB row, the l-MB row, and the m-MB row For the MB pairs belonging to the n-MB row, the o-MB row, and the p-MB row, by selecting the MB pair for which the upper right adjacent MB pair has already been selected, I15-J15, K13-L13, M11- The MB pair of N11 and O9-P9 is selected (step S14). Next, when field coding is selected, the top field MB72 is composed of the odd lines of the MB pair, and the bottom field MB73 is composed of the even lines of the MB pair. On the other hand, when frame coding is selected, the upper frame MB74 is configured by the upper half line of the MB pair, and the lower frame MB75 is configured by the lower half line of the MB pair (steps S15, S16, and step S16). S23). When field coding is selected, first, one MB included in the MB pair of I15-J15, K13-L13, M11-N11, and O9-P9 is sequentially repeated every 4 MB cycles for every 1 MB cycle. Data necessary for encoding individual MBs is set in the MB pipeline 80 (step S17, step S18, step S19). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. Next, in order to encode individual MBs for each 1 MB cycle in order over 4 MB cycles for the remaining one MB included in the MB pairs of I15-J15, K13-L13, M11-N11, and O9-P9 Necessary data is set in the MB pipeline 80 (step S20, step S21, step S22). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When frame encoding is selected, the data necessary for encoding individual MBs every 1 MB cycle in the order of I15MB, K13MB, M11MB, O9MB, J15MB, L13MB, N11MB, and P9MB is stored in the MB pipeline. 80 (step S24, step S25, step S26, step S27, step S28, step S29). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When data necessary for encoding the selected last MB is set in the MB pipeline 80, and the MB is input to the MB pipeline 80, the process returns to step S14 (steps S21 and S28), and I16. -MB pairs of J16, K14-L14, M12-N12, and O10-P10 are newly selected (step S14).

図42は、8×8SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアがMBパイプラインの各ステージを流れていく様子を示す。ここで、フィールド画像は縦方向の画素数がフレーム画像の半分であるため、縮小画像を作成するために縦方向について2画素の画素値を平均すると、フィールド画像とフレーム画像では異なる縮小画像となる。一方、縦単画素/横2画素精度の縮小画像では、フレームの縮小画像から奇数ラインを抜き出すとトップフィールドの縮小画像となり、フレームの縮小画像から偶数ラインを抜き出すとボトムフィールドの縮小画像となる。このため、本実施例では、図42に示すように、ステージ0で縦単画素/横2画素精度の参照領域をメモリに設定し、ステージ1では縦単画素/横2画素精度で動き検出を行う。   FIG. 42 shows that when MB pairs included in 8 MB rows are input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB pair flows through each stage of the MB pipeline. Show how it goes. Here, since the number of pixels in the vertical direction of the field image is half that of the frame image, when the pixel values of two pixels in the vertical direction are averaged to create a reduced image, the reduced image differs between the field image and the frame image. . On the other hand, in the reduced image of the vertical single pixel / horizontal two-pixel accuracy, when an odd line is extracted from the reduced image of the frame, a reduced image of the top field is obtained, and when an even line is extracted from the reduced image of the frame, a reduced image of the bottom field is obtained. Therefore, in this embodiment, as shown in FIG. 42, a reference area of vertical single pixel / horizontal two pixel accuracy is set in the memory at stage 0, and motion detection is performed at vertical single pixel / horizontal two pixel accuracy at stage 1. Do.

また、本実施例では、I15、K13、M11、O9等のMBペアの片方のMBが4つ連続してMBパイプラインに投入された後、J15、L13、N11、P9等のMBペアの残りの片方のMBが4つ連続して投入される。このように、MBペアの片方のMBが連続してMBパイプラインに投入されるため、その順番で動きベクトルの参照領域を更新すると、更新領域が不連続となる。そこで、ステージ0で縦単画素/横2画素精度メモリを設定するときは、図22に示すように、8つのMB行の更新領域をひとまとまりの矩形領域として設定する。   Further, in this embodiment, after four MBs in one MB pair such as I15, K13, M11, and O9 are continuously inserted into the MB pipeline, the remaining MB pairs such as J15, L13, N11, and P9 are left. Four MBs on one side of are continuously inserted. Thus, since one MB of the MB pair is continuously input into the MB pipeline, when the motion vector reference area is updated in that order, the update area becomes discontinuous. Therefore, when setting the vertical single pixel / horizontal two-pixel accuracy memory at stage 0, as shown in FIG. 22, the update areas of eight MB rows are set as a group of rectangular areas.

また、フィールド符号化とフレーム符号化のいずれかを選択するには、フィールド符号化とフレーム符号化の各々についてイントラ予測とインター予測の両方を行い、予測誤差の小さい符号化モードと予測モードの組合せを選択することが望ましい。しかし、この方法は膨大な演算量を必要とする。一方、現MBペア内の画素のみで符号化モードを判定し、選択された方のみについてイントラ予測とインター予測を行う簡易的な選択法も考えられる。たとえば、32ライン全てについて隣接したライン間で差分絶対値和または差分自乗和を求め、また、1ラインごと、すなわち奇数ライン16本と偶数ライン16本の隣接ライン間で差分絶対値和または差分自乗和を求めて、32ライン全てについて求めた方が小さかったときはフレーム符号化、1ラインごとに求めた方が小さかったときはフィールド符号化とする等の方法である。最適な選択とはならない場合もあるが、演算量は少ない。本実施例では、簡易的な選択法を用いることとし、ステージ0でフィールド/フレーム判定を行った後、選択された符号化モードについて、図42に示すようにステージ1〜4でインター予測を行い、また、それと並列してステージ3と4で4×4イントラ予測、16×16イントラ予測等を行う。   In addition, to select either field coding or frame coding, both intra prediction and inter prediction are performed for each of field coding and frame coding, and a combination of a coding mode and a prediction mode with a small prediction error. It is desirable to select. However, this method requires a huge amount of calculation. On the other hand, a simple selection method is also conceivable in which an encoding mode is determined only with pixels in the current MB pair, and intra prediction and inter prediction are performed only on the selected one. For example, the sum of absolute differences or the sum of squares of differences is calculated between adjacent lines for all 32 lines, and the sum of absolute differences or squares of differences is calculated for each line, that is, between adjacent lines of 16 odd lines and 16 even lines. When the sum is obtained and the value obtained for all 32 lines is smaller, frame coding is performed, and when the value obtained for each line is smaller, field coding is performed. Although it may not be an optimal selection, the amount of computation is small. In this embodiment, a simple selection method is used, and after performing field / frame determination at stage 0, inter prediction is performed at stages 1 to 4 as shown in FIG. 42 for the selected coding mode. In parallel with this, 4 × 4 intra prediction, 16 × 16 intra prediction, and the like are performed in stages 3 and 4.

本実施例では、実施例2〜4と同様に縦に連続した8のMB行をひとまとまりとして処理する。しかし、上記段落0122で指摘したように、フレーム符号化が選択された場合、上フレームMB74は下フレームMB75に対して上隣接MBの関係にある。また、上記段落0123で指摘したように、現MBペアと左隣接MBペアのフィールド符号化/フレーム符号化の選択が異なる場合、左隣接MBペアに含まれる両方のMBが現MBペアに含まれる個々のMBの左隣接MBとなる。このため、上フレームMB74の処理結果を3ステージ分しか下フレームMB75の処理にフィードバックできず、また、左隣接MBペアの処理結果を3ステージ分しか現MBペアの処理にフィードバックできず、縦に連続した4つのMB行をひとまとまりとして処理する実施例5と同様の制限が生じる。   In the present embodiment, as in Embodiments 2 to 4, 8 MB rows that are vertically continuous are processed as a group. However, as pointed out in paragraph 0122 above, when frame encoding is selected, the upper frame MB74 is in the relationship of the upper adjacent MB with respect to the lower frame MB75. Also, as pointed out in paragraph 0123 above, when the field encoding / frame encoding selection of the current MB pair is different from that of the left adjacent MB pair, both MBs included in the left adjacent MB pair are included in the current MB pair. It becomes the left adjacent MB of each MB. For this reason, the processing result of the upper frame MB74 can be fed back to the processing of the lower frame MB75 only for three stages, and the processing result of the left adjacent MB pair can be fed back to the processing of the current MB pair only by three stages. The same limitation as in the fifth embodiment in which four consecutive MB rows are processed as a group occurs.

具体的には、例えば、ステージ5でI15MBのイントラ・インター判定が終了したとき、同時にステージ1においてJ15MBの縦単画素/横2画素精度動き検出も終了する。このため上フレームMB74のイントラ・インター判定結果を下フレームMB75の縦単画素/横2画素精度動き検出に反映できないという制限がある。ただし、図42中に矢印で示すように、上フレームMB74のイントラ・インター判定結果はステージ2以降に反映できる。また、左隣接MBペア、上隣接MBペア、右上隣接MBペア等についてステージ5で確定したイントラ・インター判定結果はステージ1の縦単画素/横2画素精度動き検出に反映できる。そこで、ステージ1においては、左隣接MBペア、上隣接MBペア、右上隣接MBペア等の動きベクトルを参照して仮のPMVを作成し、下フレームMB75内の4つの8×8SB全てが共通にこの仮のPMVを参照して縦単画素/横2画素精度動き検出を行う。そして、ステージ2ではステージ1で検出された縦単画素/横2画素精度の候補動きベクトルの周辺領域を単画素精度メモリに設定し、ステージ3で真のPMVを作成し、ステージ3とステージ4で真のPMVを参照して単画素精度動き検出と1/4画素精度動き検出を行う。   Specifically, for example, when I15 MB intra / inter determination is completed in stage 5, J15MB vertical single pixel / horizontal two pixel accuracy motion detection is also ended in stage 1 at the same time. For this reason, there is a limitation that the intra / inter determination result of the upper frame MB74 cannot be reflected in the vertical single pixel / horizontal two-pixel accuracy motion detection of the lower frame MB75. However, as indicated by arrows in FIG. 42, the intra / inter determination result of the upper frame MB74 can be reflected in the stage 2 and subsequent stages. Also, the intra / inter determination results determined in stage 5 for the left adjacent MB pair, the upper adjacent MB pair, the upper right adjacent MB pair, and the like can be reflected in the vertical single pixel / horizontal two pixel accuracy motion detection in stage 1. Therefore, in stage 1, a temporary PMV is created with reference to motion vectors such as the left adjacent MB pair, the upper adjacent MB pair, and the upper right adjacent MB pair, and all four 8 × 8 SBs in the lower frame MB75 are shared. With reference to the provisional PMV, the vertical single pixel / horizontal two-pixel accuracy motion detection is performed. Then, in stage 2, the peripheral area of the candidate motion vector of vertical single pixel / horizontal two pixel precision detected in stage 1 is set in the single pixel precision memory, and a true PMV is created in stage 3, and stage 3 and stage 4 Then, single-pixel accuracy motion detection and quarter-pixel accuracy motion detection are performed with reference to the true PMV.

図43はステージ3と4におけるSBパイプラインの詳細な動作を示す。1つのMB内に含まれる4つの8×8SBについて0番から3番までシリアルに処理される。このため、単画素精度動き検出と1/4画素精度動き検出では隣接8×8SBの動きベクトルを考慮した真のPMVに基づいて動き検出を行うことができる。   FIG. 43 shows the detailed operation of the SB pipeline in stages 3 and 4. Four 8 × 8 SBs included in one MB are serially processed from No. 0 to No. 3. For this reason, in the single-pixel precision motion detection and the quarter-pixel precision motion detection, it is possible to perform motion detection based on a true PMV in consideration of the adjacent 8 × 8 SB motion vector.

ただし、本実施例では、空間ダイレクトアドレスの評価が別途必要となる。ステージ1で仮のPMVに基づいて縦単画素/横2画素精度動き検出が行われ、ステージ2ではステージ1で検出された候補動きベクトルの周辺領域が単画素精度メモリに設定される。ステージ1の仮のPMVとステージ3の真のPMVが異なる場合、ステージ3と4で動き検出する領域に空間ダイレクトアドレスに対応する位置のMBや8×8SB等が含まれない場合がある。そこで、ステージ3およびステージ4と並列に空間ダイレクトアドレスに対応する位置のMBや8×8SBのコストを評価する処理を行う必要がある。   However, in this embodiment, it is necessary to separately evaluate the space direct address. In stage 1, vertical single-pixel / horizontal 2-pixel precision motion detection is performed based on the temporary PMV, and in stage 2, the peripheral area of the candidate motion vector detected in stage 1 is set in the single-pixel precision memory. When the temporary PMV of stage 1 and the true PMV of stage 3 are different, the area where motion is detected in stages 3 and 4 may not include the MB corresponding to the spatial direct address, 8 × 8 SB, or the like. Therefore, it is necessary to perform processing for evaluating the MB of the position corresponding to the spatial direct address and the cost of 8 × 8 SB in parallel with stage 3 and stage 4.

4×4イントラ予測のために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、個々のMBペアがMBパイプラインの各ステージを流れていく様子を図44に示す。また、図45はステージ3と4におけるSBパイプラインの詳細な動作を示す。ここで、上記段落0122と段落0123で指摘した条件を満たすために、実施例5と同様に動き補償はステージ6で行われる。すなわち、上フレームMB74について動き補償が行われた後に下フレームMB75についてイントラ予測が行われ、かつ、左隣接MBペアに含まれる両方のMBについて動き補償が行われた後に現MBペアについてイントラ予測が行われるという条件を満たすために、動き補償はステージ6で行われる。   FIG. 44 shows how each MB pair flows through each stage of the MB pipeline when an MB pair included in 8 MB rows is inserted into one MB pipeline for 4 × 4 intra prediction. Show. FIG. 45 shows the detailed operation of the SB pipeline in stages 3 and 4. Here, in order to satisfy the conditions pointed out in the above paragraphs 0122 and 0123, motion compensation is performed in the stage 6 as in the fifth embodiment. That is, intra prediction is performed for the lower frame MB75 after motion compensation is performed for the upper frame MB74, and intra prediction is performed for the current MB pair after motion compensation is performed for both MBs included in the left adjacent MB pair. In order to satisfy the condition that it is performed, motion compensation is performed at stage 6.

また、ステージ7の可変長符号化による発生符号量の変動を調整するため、量子化パラメータを変更するというレート制御をステージ8で行う必要が生じる場合がある。この場合、実施例5と同様に、ステージ5のイントラ・インター判定において4×4イントラ予測モードを選択しないようにするか、または4×4イントラ予測モードが選択されたときはステージ6で新しい量子化パラメータを用いて整数変換・量子化・逆量子化・逆整数変換をやり直す必要がある。   In addition, in order to adjust fluctuations in the amount of generated code due to variable length coding in stage 7, it may be necessary to perform rate control in stage 8 to change the quantization parameter. In this case, as in the fifth embodiment, the 4 × 4 intra prediction mode is not selected in the intra / inter determination of stage 5, or a new quantum is determined in stage 6 when the 4 × 4 intra prediction mode is selected. It is necessary to redo integer conversion, quantization, inverse quantization, and inverse integer conversion using the quantization parameter.

なお、本実施例で示したMBパイプラインのステージ構成は一例であって、他のステージ構成とすることも可能である。そして、ステージ構成が変われば、ひとまとまりとして符号化する縦に連続する複数のMB行の数が同じであっても、動き検出やイントラ予測等における制約は変わる。   Note that the stage configuration of the MB pipeline shown in this embodiment is merely an example, and other stage configurations may be used. If the stage configuration changes, the constraints in motion detection, intra prediction, and the like change even if the number of vertically continuous MB rows encoded as a group is the same.

また、本実施例に記載された発明と実施例6〜実施例12に記載された発明を同時に動画像符号化装置に適用することも可能である。   In addition, the invention described in the present embodiment and the invention described in the sixth to twelfth embodiments can be simultaneously applied to a moving picture coding apparatus.

本発明は、ハードウェアの動画像符号化装置の分野で利用価値が高い。   The present invention has a high utility value in the field of hardware moving image encoding devices.

MBパイプラインに連続して投入されるMBの例を示した説明図である。(実施例1)It is explanatory drawing which showed the example of MB thrown continuously into MB pipeline. Example 1 本発明が適用される動画像符号化装置のブロック図である。(実施例1)It is a block diagram of the moving image encoder to which the present invention is applied. Example 1 本発明が適用される動画像符号化方法の処理のフローチャートである。(実施例1)It is a flowchart of a process of the moving image encoding method to which this invention is applied. Example 1 図1に例示される4個のMBを1個のMBパイプラインに連続して投入したときに、各MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。(実施例1)FIG. 2 is an explanatory diagram showing a state in which each MB flows through each stage of the MB pipeline when the four MBs exemplified in FIG. 1 are continuously input into one MB pipeline. Example 1 図1のピクチャを構成する各MBがMBパイプラインに投入され、ステージ0の処理が開始されるMBサイクル番号を示した説明図である。(実施例1)FIG. 2 is an explanatory diagram showing MB cycle numbers at which the MBs constituting the picture of FIG. 1 are input to the MB pipeline and stage 0 processing is started. Example 1 8画素×8画素の4つのSBに分割されたMBを示した説明図である。(実施例2)It is explanatory drawing which showed MB divided | segmented into 4 SB of 8 pixels x 8 pixels. (Example 2) MBパイプラインに連続して投入されるMBの例を示した説明図である。(実施例2)It is explanatory drawing which showed the example of MB thrown continuously into MB pipeline. (Example 2) 8画素×8画素SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。(実施例2)In order to detect a motion vector for every 8 pixels × 8 pixels SB, when MBs included in 8 MB rows are continuously input to one MB pipeline, each MB flows through each stage. It is explanatory drawing shown. (Example 2) 本発明が適用される動きベクトル検出回路のブロック図である。(実施例2)It is a block diagram of a motion vector detection circuit to which the present invention is applied. (Example 2) 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。(実施例2)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. (Example 2) 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。(実施例3)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. (Example 3) 本発明が適用される動きベクトル検出回路のブロック図である。(実施例3)It is a block diagram of a motion vector detection circuit to which the present invention is applied. (Example 3) 16個の4画素×4画素SBに分割されたMBを示した説明図である。(実施例4)It is explanatory drawing which showed MB divided | segmented into 16 4 pixels x 4 pixels SB. (Example 4) 4画素×4画素イントラ予測のために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。(実施例4)An explanatory diagram showing how each MB flows through each stage when MBs included in 8 MB rows are continuously input to one MB pipeline for 4 pixel × 4 pixel intra prediction. is there. (Example 4) 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。(実施例4)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. (Example 4) 8×8SBごとの動きベクトルを検出するために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。(実施例5)When MBs included in four MB rows are continuously input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB flows through each stage of the MB pipeline. It is explanatory drawing which showed. (Example 5) 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。(実施例5)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. (Example 5) 4画素×4画素イントラ予測のために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。(実施例5)An explanatory diagram showing how each MB flows through each stage when MBs included in four MB rows are continuously input to one MB pipeline for 4 pixel × 4 pixel intra prediction. is there. (Example 5) 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。(実施例5)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. (Example 5) 内部メモリを有する動画像符号化装置のブロック図である。(実施例6)It is a block diagram of the moving image encoder which has an internal memory. (Example 6) 縦に連続する4つのMB行に含まれる4個のMBを1個のMBパイプラインで処理する場合の参照領域を示した説明図である。(実施例6)It is explanatory drawing which showed the reference area | region in the case of processing 4 MB contained in 4 vertical MB lines by one MB pipeline. (Example 6) 参照領域用メモリに参照領域を記憶するもう一つの方法を示した説明図である。(実施例6)It is explanatory drawing which showed another method which memorize | stores a reference area in the memory for reference areas. (Example 6) 広い範囲で動きを検出できる動き検出装置と、本発明が適用されたMBパイプラインを含む動画像符号化装置の組み合わせを示した説明図である。(実施例7)It is explanatory drawing which showed the combination of the motion detection apparatus which can detect a motion in a wide range, and the moving image encoding apparatus containing MB pipeline to which this invention was applied. (Example 7) 2つの動画像符号化装置と内部メモリを有する並列動画像符号化装置のブロック図である。(実施例8)It is a block diagram of a parallel moving image encoding device having two moving image encoding devices and an internal memory. (Example 8) 2つの動画像符号化装置が分担するピクチャの領域を示した説明図である。(実施例8)It is explanatory drawing which showed the area | region of the picture which two moving image encoders share. (Example 8) 2つの動画像符号化装置に含まれるMBパイプラインの各ステージをMBが流れていく様子を示した説明図である。(実施例8)It is explanatory drawing which showed a mode that MB flows through each stage of MB pipeline contained in two moving image encoders. (Example 8) 推定発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。(実施例9)It is a block diagram of a CABAC encoder that performs rate control based on an estimated generated code amount. Example 9 コンテクスト情報復元回路の処理フローを示す図である。(実施例9)It is a figure which shows the processing flow of a context information restoration circuit. Example 9 仮の発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。(実施例10)It is a block diagram of a CABAC encoder that performs rate control based on a provisional generated code amount. (Example 10) 縦に連続する4つのMB行をひとまとまりとして符号化を行う場合の仮算術符号化回路のブロック図である。(実施例10)It is a block diagram of a provisional arithmetic encoding circuit when encoding is performed with a group of four vertically continuous MB rows. (Example 10) 仮算術符号化回路においてMB行内の先頭のMBについて仮のrange、low、および確率テーブルを設定する方法の一つを説明する図である。(実施例10)It is a figure explaining one of the methods of setting a temporary range, low, and a probability table about the head MB in MB row in a temporary arithmetic coding circuit. (Example 10) 2並列で仮算術符号化を行う場合の仮算術符号化回路のブロック図である。(実施例10)It is a block diagram of a provisional arithmetic coding circuit when performing provisional arithmetic coding in two parallel. (Example 10) 2並列で仮算術符号化を行う場合にMBがMBパイプラインの各ステージを流れていく様子を示した説明図である。(実施例10)It is explanatory drawing which showed a mode that MB flows through each stage of MB pipeline, when provisional arithmetic coding is performed in 2 parallel. (Example 10) CAVLCで圧縮する場合のCABAC符号化器のブロック図である。(実施例11)It is a block diagram of the CABAC encoder in the case of compressing by CAVLC. (Example 11) 2つの動画像符号化装置で構成される並列動画像符号化装置から2値化シンボルを出力し、CABACで符号化された1本のビットストリームを生成する並列動画像符号化装置のブロック図である。(実施例12)FIG. 2 is a block diagram of a parallel moving image encoding device that outputs a binary symbol from a parallel moving image encoding device configured by two moving image encoding devices and generates one bit stream encoded by CABAC. is there. (Example 12) 2つの動画像符号化装置で構成される並列動画像符号化装置からCAVLC符号化ビットストリームを出力し、CABACで符号化された1本のビットストリームを生成する並列動画像符号化装置のブロック図である。(実施例12)Block diagram of a parallel video encoding device that outputs a CAVLC encoded bitstream from a parallel video encoding device composed of two video encoding devices and generates one bitstream encoded by CABAC It is. (Example 12) フィールド符号化が選択されたときのMBペアとフレーム符号化が選択されたときのMBペアを示した説明図である。(実施例13)It is explanatory drawing which showed MB pair when a frame encoding is selected, and MB pair when field encoding is selected. (Example 13) 現MBペアはフィールド符号化が選択され、左隣接MBペアはフレーム符号化が選択された場合の左隣接MBペアと、現MBペアはフレーム符号化が選択され、左隣接MBペアはフィールド符号化が選択された場合の左隣接MBペアを示した説明図である。(実施例13)Field coding is selected for the current MB pair, frame coding is selected for the left adjacent MB pair when the frame coding is selected for the left adjacent MB pair, frame coding is selected for the current MB pair, and field coding is performed for the left adjacent MB pair It is explanatory drawing which showed the left adjacent MB pair when is selected. (Example 13) MBパイプラインに投入されるMBペアの例を示した説明図である。(実施例13)It is explanatory drawing which showed the example of the MB pair thrown into MB pipeline. (Example 13) 本発明が適用される動画像符号化装置のブロック図である。(実施例13)It is a block diagram of the moving image encoder to which the present invention is applied. (Example 13) 本発明が適用される動画像符号化方法の処理のフローチャートである。(実施例13)It is a flowchart of a process of the moving image encoding method to which this invention is applied. (Example 13) 8画素×8画素SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアが各ステージを流れていく様子を示した説明図である。(実施例13)In order to detect a motion vector for every 8 pixels × 8 pixels SB, when MB pairs included in 8 MB rows are input to one MB pipeline, each MB pair flows through each stage. FIG. (Example 13) 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。(実施例13)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. (Example 13) 4画素×4画素イントラ予測のために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアがMBパイプラインの各ステージを流れていく様子を示した説明図である。(実施例13)When MB pairs included in 8 MB rows are input to one MB pipeline for 4 pixel × 4 pixel intra prediction, each MB pair flows through each stage of the MB pipeline. It is explanatory drawing. (Example 13) 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。(実施例13)It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. (Example 13) MPEG−2の符号化器のブロック図である。(背景技術)It is a block diagram of an MPEG-2 encoder. (Background technology) H.264の符号化器のブロック図である。(背景技術)H. 2 is a block diagram of an H.264 encoder. FIG. (Background technology) 従来のH.264の符号化器のMBパイプラインにおいて、MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。(背景技術)Conventional H.264. 2 is an explanatory diagram showing a state in which an MB flows through each stage of the MB pipeline in an MB pipeline of an H.264 encoder. FIG. (Background technology) 従来の動きベクトル検出器の構成を示したブロック図である。(背景技術)It is the block diagram which showed the structure of the conventional motion vector detector. (Background technology) 隣接する2つのMBの参照領域の例を示した説明図である。(背景技術)It is explanatory drawing which showed the example of the reference area of two adjacent MB. (Background technology) ピクチャ分割方法を示した説明図である。(背景技術)It is explanatory drawing which showed the picture division | segmentation method. (Background technology) CABAC符号化器のブロック図である。(背景技術)It is a block diagram of a CABAC encoder. (Background technology) 算術符号化回路の処理内容を表すBiari_encode_symbol処理フローである。(背景技術)It is a Biari_encode_symbol processing flow showing the processing contents of the arithmetic encoding circuit. (Background technology) symbolがLPSであるときのrangeとlowの変化と、symbolがMPSであるときのrangeとlowの変化を示した説明図である。(背景技術)It is explanatory drawing which showed the change of range and low when symbol is LPS, and the change of range and low when symbol is MPS. (Background technology)

符号の説明Explanation of symbols

1 MBパイプライン
2 MB選択回路
3 符号化データ設定回路
4 外部メモリ
5 2画素精度画像作成回路
6 2画素精度メモリ
7 2画素精度動き検出回路
8 単画素精度メモリ
9 単画素精度動き検出回路
10 1/4画素精度画像作成回路
11 1/4画素精度動き検出回路
12 動きベクトル検出回路
13 動きベクトル検出回路
14 参照領域用メモリ
15 バッファメモリ
16 動き検出部
17 動き補償部
18 イントラ予測部
19 整数変換・量子化・逆量子化・逆整数変換部
20 可変長符号化部
21 デブロッキングフィルタ部
22 制御部
23 動画像符号化装置
24、25、26、27 MB
28、29、30、31 参照領域
32、33、34、35 更新領域
36 参照領域28、29、30、34を全て含む矩形の領域
37 更新領域
38 動き検出装置
39 内部メモリ
40、41 動画像符号化装置
42 並列動画像符号化装置
43 2値化回路
44 発生符号量推定回路
45 2値化シンボル記憶回路
46 算術符号化回路
47 コンテクスト情報復元回路
48 仮算術符号化回路
49 仮算術符号化回路内のコンテクスト計算部分
50 仮算術符号化回路内の算術符号化部分
51〜54 仮算術符号化回路内のrangeを記憶する部分
55〜58 仮算術符号化回路内のlowを記憶する部分
59〜62 仮算術符号化回路内の確率テーブル
63、65 2値化シンボルを2MBサイクル保持するためのメモリ
64、66 シンタックッスデータを2MBサイクル保持するためのメモリ
67 セレクタ
68 2並列で仮算術符号化を行う仮算術符号化回路
69 CAVLC符号化回路
70 CAVLC符号化ビットストリーム記憶回路
71 CAVLC復号回路
72 トップフィールドMB
73 ボトムフィールドMB
74 上フレームMB
75 下フレームMB
76 上フレームMB奇数ライン
77 下フレームMB奇数ライン
78 トップフィールドMB上半分16ライン
79 ボトムフィールドMB上半分16ライン
80 MBパイプライン
81 MBペア選択回路
82 フィールドMBペア/フレームMBペア構成回路
83 符号化データ設定回路
84 DCT
85 量子化
86 逆量子化
87 逆DCT
88 フレームメモリ
89 動き補償
90 動き検出
91 可変長符号化
92 レート制御
93 整数変換
94 量子化
95 逆量子化
96 逆整数変換
97 イントラ予測
98 デブロッキングフィルタ
99 フレームメモリ
100 動き補償
101 動き検出
102 可変長符号化
103 レート制御
104 内部メモリ
105 動き検出回路
106 動き検出器
107、108 MB
109、110 参照領域
111 更新領域
112 2値化回路
113 コンテクスト計算回路
114 算術符号化回路
115 確率テーブル
DESCRIPTION OF SYMBOLS 1 MB pipeline 2 MB selection circuit 3 Encoding data setting circuit 4 External memory 5 Two pixel precision image creation circuit 6 Two pixel precision memory 7 Two pixel precision motion detection circuit 8 Single pixel precision memory 9 Single pixel precision motion detection circuit 10 1 / 4 pixel precision image creation circuit 11 ¼ pixel precision motion detection circuit 12 motion vector detection circuit 13 motion vector detection circuit 14 reference area memory 15 buffer memory 16 motion detection unit 17 motion compensation unit 18 intra prediction unit 19 integer conversion / Quantization / inverse quantization / inverse integer transform unit 20 variable length coding unit 21 deblocking filter unit 22 control unit 23 moving image coding device 24, 25, 26, 27 MB
28, 29, 30, 31 Reference area 32, 33, 34, 35 Update area 36 Rectangular area including all reference areas 28, 29, 30, 34 34 Update area 38 Motion detector 39 Internal memory 40, 41 Video code 42 parallel video coding device 43 binarization circuit 44 generated code amount estimation circuit 45 binarized symbol storage circuit 46 arithmetic coding circuit 47 context information restoration circuit 48 temporary arithmetic coding circuit 49 in temporary arithmetic coding circuit 50 The arithmetic coding part in the provisional arithmetic coding circuit 51 to 54 The part storing the range in the temporary arithmetic coding circuit 55 to 58 The part storing the low in the temporary arithmetic coding circuit 59 to 62 Probability table 63, 65 in arithmetic coding circuit Memory 64, 66 for holding 2 MB cycles of binarized symbols Provisional arithmetic coding circuit 69 CAVLC encoding circuit 70 CAVLC coded bit stream storage circuit 71 CAVLC decoding circuit 72 the top field MB performing temporary arithmetic coding in the memory 67 the selector 68 2 parallel to the to 2MB cycle held Kussudeta
73 Bottom Field MB
74 Upper frame MB
75 Lower frame MB
76 Upper frame MB odd line 77 Lower frame MB odd line 78 Top field MB upper half 16 lines 79 Bottom field MB upper half 16 lines 80 MB pipeline 81 MB pair selection circuit 82 Field MB pair / frame MB pair configuration circuit 83 Coding Data setting circuit 84 DCT
85 Quantization 86 Inverse quantization 87 Inverse DCT
88 frame memory 89 motion compensation 90 motion detection 91 variable length coding 92 rate control 93 integer transform 94 quantization 95 inverse quantization 96 inverse integer transform 97 intra prediction 98 deblocking filter 99 frame memory 100 motion compensation 101 motion detection 102 variable length Encoding 103 Rate control 104 Internal memory 105 Motion detection circuit 106 Motion detector 107, 108 MB
109, 110 Reference area 111 Update area 112 Binary circuit 113 Context calculation circuit 114 Arithmetic coding circuit 115 Probability table

MB行内の先頭のMBでは、通常上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行う。しかし、本発明では縦に連続する複数のMB行をひとまとまりとして符号化を進めるため、MB行内の先頭のMBを符号化するとき上に隣り合うMB行内の最後のMBは符号化が終わっていない。このため、縦に連続するひとまとまりのMB行の符号化が終了するまで、上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行うことができない。そこで、MB行内の先頭のMBについては仮の値をrange、low、および確率テーブルに設定して仮算術符号化を開始する。 In the first MB in the MB row, arithmetic coding is performed by taking over the range, low, and probability table when the arithmetic coding of the last MB in the adjacent MB row is finished. However, in the present invention, since encoding is performed with a plurality of vertically continuous MB rows as a group, when the first MB in the MB row is encoded, the last MB in the upper adjacent MB row has been encoded. Absent. For this reason, until encoding of a group of consecutive MBs is completed, the arithmetic is performed by taking over the range, low, and probability table when arithmetic coding of the last MB in the adjacent MB row is completed. Encoding cannot be performed. Thus, for the first MB in the MB row, provisional values are set in the range, low, and probability tables, and provisional arithmetic coding is started.

本発明は、動画像のデータ量を圧縮・削減するための動画像符号化装置および動画像符号化方法に関するものである。 The present invention relates to a moving image encoding apparatus and a moving image encoding method for compressing and reducing the amount of moving image data.

動画像には、720Pのようにフレームで構成されるものと、1080iのようにフィールドで構成されるものがあるが、本発明はフレームで構成されるものに適用してもフィールドで構成されるものに適用してもその目的を達成でき、同様の作用・効果を生じる。そこで、以下では、動画像を構成する1枚の画像を示すためにピクチャという用語を用いる。ピクチャはフレームとフィールドの両方を表すものとする。   Some moving images are composed of frames such as 720P and others are composed of fields such as 1080i, but the present invention is composed of fields even when applied to those composed of frames. Even if it is applied to things, the purpose can be achieved, and similar actions and effects are produced. Therefore, in the following, the term “picture” is used to indicate one image constituting a moving image. A picture shall represent both a frame and a field.

MPEG−2やH.264(MPEG−4 AVCとも呼ばれる)、VC−1等の動画像符号化方式では、画面を16画素×16画素や8画素×8画素等のマクロブロック(以下、MBという。)に分割し、MB単位で動き検出、動き補償、DCTまたは整数変換等の周波数変換、量子化、可変長符号化等を行う。これらの動画像符号化方式では、符号化効率を向上させるために、符号化済みの周辺MBの結果をフィードバックし、符号化中のMB(以下、現MBという。)の処理内容を決める適応処理が行われる。   MPEG-2 and H.264 In a moving image coding system such as H.264 (also referred to as MPEG-4 AVC) or VC-1, the screen is divided into macroblocks (hereinafter referred to as MB) of 16 pixels × 16 pixels or 8 pixels × 8 pixels. Motion detection, motion compensation, frequency conversion such as DCT or integer conversion, quantization, variable length coding, and the like are performed in MB units. In these moving image encoding systems, in order to improve the encoding efficiency, the result of the encoded peripheral MB is fed back, and adaptive processing for determining the processing content of the MB being encoded (hereinafter referred to as the current MB). Is done.

図46はMPEG−2の符号化器のブロック図を示す。MPEG−2では発生符号量が局所的に変動することを防ぐために、個々のMBの量子化パラメータを変更することによって発生符号量を制御する。これをレート制御92という。レート制御92では、可変長符号化91の結果発生した符号化済みMBの符号量に応じて現MBの量子化パラメータを変更する。例えば、左隣接MBの発生符号量が大きい場合、現MBの量子化パラメータを大きくし、現MBの発生符号量を減少させる。   FIG. 46 shows a block diagram of an MPEG-2 encoder. In MPEG-2, in order to prevent the generated code amount from fluctuating locally, the generated code amount is controlled by changing the quantization parameter of each MB. This is called rate control 92. In the rate control 92, the quantization parameter of the current MB is changed according to the code amount of the encoded MB generated as a result of the variable length encoding 91. For example, when the generated code amount of the left adjacent MB is large, the quantization parameter of the current MB is increased and the generated code amount of the current MB is decreased.

図47はH.264の符号化器のブロック図を示す。H.264はMPEG−2に比べて2倍程度の効率で動画像を圧縮できる。この高い圧縮効率を実現するために、H.264では、動き補償100における参照ピクチャ数の増加、可変ブロックサイズ動き補償や4画素×4画素単位の周波数変換(以下、整数変換93という。)が採用されると共に、レート制御103に加えて以下の3つの適応処理が新たに導入された。ここで、可変ブロックサイズ動き補償とは、MBを8画素×16画素、8画素×8画素、4画素×4画素等のサブブロック(以下、SBという。)に分割し、SBごとに動き補償を行うことをいう。以下では、単にブロックというときには、MBとSBの両方を意味するものとする。   FIG. 2 shows a block diagram of an H.264 encoder. H. H.264 can compress moving images with twice the efficiency of MPEG-2. In order to achieve this high compression efficiency, H.264 employs an increase in the number of reference pictures in motion compensation 100, variable block size motion compensation, and frequency conversion in units of 4 pixels × 4 pixels (hereinafter referred to as integer conversion 93), and in addition to rate control 103, The three adaptive processes are newly introduced. Here, variable block size motion compensation means that MB is divided into sub-blocks (hereinafter referred to as SB) such as 8 pixels × 16 pixels, 8 pixels × 8 pixels, 4 pixels × 4 pixels, etc., and motion compensation is performed for each SB. To do. Hereinafter, when simply referring to a block, both MB and SB are meant.

(1)予測誤差の符号量だけではなく、参照ピクチャの符号量と動きベクトルの符号量を考慮し、それらの合計符号量が最小となる参照ピクチャ、動きベクトル、およびブロックの組み合わせを選択する。動きベクトルについては、左隣接ブロック、上隣接ブロック、および右上隣接ブロックの動きベクトルから予測される予測動きベクトル(以下、PMVという。)を求め、PMVと現ブロックの動きベクトルの差分を符号化する。また、左隣接ブロック、上隣接ブロック、および右上隣接ブロックの動きベクトルは、空間ダイレクトモードの動きベクトルを求めるときにも参照される。 (1) Considering not only the code amount of a prediction error but also the code amount of a reference picture and the code amount of a motion vector, a combination of a reference picture, a motion vector, and a block that minimizes the total code amount thereof is selected. For the motion vector, a predicted motion vector (hereinafter referred to as PMV) predicted from the motion vectors of the left adjacent block, the upper adjacent block, and the upper right adjacent block is obtained, and the difference between the motion vector of the PMV and the current block is encoded. . In addition, the motion vectors of the left adjacent block, the upper adjacent block, and the upper right adjacent block are also referred to when obtaining the motion vector in the spatial direct mode.

(2)隣接MBの再生画素から予測値を作成し、イントラ予測97を行う。輝度信号については4画素×4画素SB(以下、4×4SBという。)のイントラ予測モードと16×16画素ブロックのイントラ予測モードがある。輝度信号の4×4SBのイントラ予測モードでは、左隣接4×4SB、上隣接4×4SB、および右上隣接4×4SBの再生画素から現4×4SBのイントラ予測値を作成し、このイントラ予測値と現4×4SBの画素の差分を符号化する。この差分画素を整数変換・量子化・逆量子化・逆整数変換し、その結果にイントラ予測値を加算することにより再生画素が作成される。16×16画素ブロックのイントラ予測モードでは左隣接MBと上隣接MBの再生画素から現16×16画素ブロックのイントラ予測値を作成し、このイントラ予測値と現16×16画素ブロックの画素の差分を符号化する。 (2) A prediction value is created from the reproduced pixels of the adjacent MB, and intra prediction 97 is performed. As for the luminance signal, there are an intra prediction mode of 4 pixels × 4 pixels SB (hereinafter referred to as 4 × 4 SB) and an intra prediction mode of 16 × 16 pixel blocks. In the 4 × 4SB intra prediction mode of the luminance signal, an intra prediction value of the current 4 × 4SB is generated from the reproduction pixels of the left adjacent 4 × 4SB, the upper adjacent 4 × 4SB, and the upper right adjacent 4 × 4SB, and this intra predicted value And the difference between the current 4 × 4 SB pixels. The difference pixel is subjected to integer transformation / quantization / inverse quantization / inverse integer transformation, and an intra prediction value is added to the result, thereby generating a reproduction pixel. In the 16 × 16 pixel block intra prediction mode, an intra prediction value of the current 16 × 16 pixel block is created from the reproduction pixels of the left adjacent MB and the upper adjacent MB, and the difference between the intra prediction value and the pixel of the current 16 × 16 pixel block is created. Is encoded.

(3)4画素×4画素ブロックの境界にデブロッキングフィルタ98をかけ、ブロックノイズを除去する。 (3) A deblocking filter 98 is applied to the boundary of the 4 pixel × 4 pixel block to remove block noise.

一方、ハードウェアの動画像符号化装置では、回路の稼働率を上げるためにMB単位のパイプライン(本特許請求の範囲および明細書では、マクロブロックパイプラインまたはMBパイプラインという。)が採用されるのが一般的である(例えば、非特許文献1のpp.126-128、図3参照)。また、ハードウェアの動画像符号化装置では、通常横方向のMBの並び(以下MB行という)内では左端MBから右端MBに向かって符号化される。そして、1つのMB行に含まれる右端のMBの符号化が終了すると、次にその下のMB行に属するMBが左端MBから右端MBに向かって符号化される。これがピクチャの最も上のMB行からピクチャの最も下のMB行まで繰り返される。図48は、従来のH.264の符号化器のMBパイプラインにおいて、MBがMBパイプラインの各ステージを流れていく様子を示したものである。n−1、n、およびn+1はあるMB行中の左からそれぞれn−1番目、n番目、n+1番目のMBを表す。また、MBサイクルとは、MBパイプラインの各ステージで1個のMBが処理されるために要する時間の単位をいい、各ステージでは1MBサイクルで1個のMBが処理される。   On the other hand, a hardware moving image encoding apparatus employs a pipeline in MB units (referred to as a macroblock pipeline or an MB pipeline in the claims and the specification) in order to increase the operation rate of a circuit. (For example, see Non-Patent Document 1, pp. 126-128, FIG. 3). Further, in a hardware moving image encoding apparatus, encoding is generally performed from the left end MB toward the right end MB in a horizontal MB array (hereinafter referred to as MB row). When the encoding of the rightmost MB included in one MB row is completed, the MBs belonging to the lower MB row are encoded from the left end MB toward the right end MB. This is repeated from the top MB row of the picture to the bottom MB row of the picture. FIG. In the MB pipeline of the H.264 encoder, the manner in which the MB flows through each stage of the MB pipeline is shown. n-1, n, and n + 1 represent the (n-1) th, nth, and n + 1th MBs from the left in a certain MB row, respectively. The MB cycle is a unit of time required for processing one MB in each stage of the MB pipeline. In each stage, one MB is processed in one MB cycle.

図48では、ステージ0で1MBサイクルかけて外部メモリから1個のMBの符号化に必要なデータを読み出す。ステージ1で1MBサイクルかけて1個のMBについて粗い精度の動き検出を行う。ステージ2で1MBサイクルかけてステージ1で検出された粗い精度の候補動きベクトルの周囲の狭い範囲で詳細な動き検出を行うと共に、イントラ予測を行う。ステージ3では1MBサイクルかけて1個のMBについて整数変換、量子化、逆量子化、および逆整数変換を行う。ステージ4では1MBサイクルかけて1個のMBについて可変長符号化と動き補償を行う。そして、ステージ5で1MBサイクルかけて1個のMBについてレート制御とデブロッキングフィルタを行い、ステージ6で1MBサイクルかけて1個のMB分の再生画素やビットストリームを外部メモリに書き込む。MBサイクルを1000サイクルと仮定すると、MBパイプラインを行わない場合には1個のMBの符号化処理に7000サイクルかかるのに対し、図48のMBパイプラインでは1000サイクルごとに1つのMBの符号化が終了する。   In FIG. 48, data necessary for encoding one MB is read out from the external memory over 1 MB cycle in stage 0. Stage 1 performs coarse motion detection for one MB over 1 MB cycle. Detailed motion detection is performed in a narrow range around the coarse motion candidate motion vector detected in stage 1 over 1 MB cycle in stage 2 and intra prediction is performed. In stage 3, integer conversion, quantization, inverse quantization, and inverse integer conversion are performed on one MB over 1 MB cycle. In stage 4, variable length coding and motion compensation are performed for one MB over one MB cycle. Then, stage 1 performs rate control and deblocking filtering on one MB over 1 MB cycle, and stage 6 writes a reproduction pixel or bit stream for one MB over 1 MB cycle to the external memory. Assuming that the MB cycle is 1000 cycles, the encoding process of one MB takes 7000 cycles when the MB pipeline is not performed, whereas the MB pipeline in FIG. 48 has one MB code every 1000 cycles. The conversion ends.

しかし、このMBパイプラインで左隣接MBの処理結果に応じた適応処理を行うためには、以下の4点の課題がある。   However, in order to perform adaptive processing according to the processing result of the left adjacent MB in this MB pipeline, there are the following four problems.

(1)図48に示すように、n−1番目のMBについてレート制御が終了したとき、既にn+1番目のMBまで量子化が終了している。従って、n−1番目のMBの発生符号量に応じて量子化パラメータを変更できるのは、n+2番目以降のMBである。すなわち、2MB分レート制御が遅れる。 (1) As shown in FIG. 48, when the rate control is finished for the (n-1) th MB, the quantization has already been finished up to the (n + 1) th MB. Therefore, the quantization parameter can be changed according to the generated code amount of the (n−1) th MB for the (n + 2) th and subsequent MBs. That is, 2 MB rate control is delayed.

(2)図48では動き検出をMBパイプライン2段で実行し、ステージ2で高精度の動きベクトル検出と同時にイントラ予測を実行している。高精度の動きベクトルが決定し、かつイントラ予測かインター予測かが決まらなければ正確なPMVは算出できないが、n−1番目のMBについて高精度の動きベクトルとイントラ予測かインター予測かが決まったときにはn番目のMBについてステージ1における粗い精度の動きベクトル検出は終了している。このため、図48のMBパイプラインでは、左隣接MBについては荒い精度の動きベクトル検出結果しか考慮して動きベクトルを選択することはできず、左隣接MBにおける高精度の動きベクトルおよびイントラ予測/インター予測判定結果を考慮して動きベクトルを選択することができない。加えて、H.264ではMBを分割した8画素×16画素、8画素×8画素、4画素×4画素等のSBでも動きベクトルの符号量を考慮して動きベクトル検出を行うことが望ましいが、図48のMBパイプラインでは左隣接SB、上隣接SB、および右上隣接SBの動きベクトルの符号量を考慮して動きベクトル検出を行うことは困難である。 (2) In FIG. 48, motion detection is executed in two stages of the MB pipeline, and intra prediction is executed simultaneously with high-precision motion vector detection in stage 2. An accurate PMV cannot be calculated unless a high-precision motion vector is determined and intra prediction or inter prediction is determined, but a high-precision motion vector and intra prediction or inter prediction are determined for the (n-1) th MB. Sometimes the motion vector detection with coarse accuracy in the stage 1 is finished for the nth MB. For this reason, in the MB pipeline of FIG. 48, a motion vector cannot be selected considering only a rough accuracy motion vector detection result for the left adjacent MB, and a highly accurate motion vector and intra prediction / A motion vector cannot be selected in consideration of the inter prediction determination result. In addition, H.C. In H.264, it is desirable to perform motion vector detection in consideration of the code amount of the motion vector even in the SB of 8 pixels × 16 pixels, 8 pixels × 8 pixels, 4 pixels × 4 pixels, and the like obtained by dividing the MB. In a pipeline, it is difficult to perform motion vector detection in consideration of the code amounts of the motion vectors of the left adjacent SB, the upper adjacent SB, and the upper right adjacent SB.

(3)16画素×16画素ブロックイントラ予測モードは、左隣接16画素×16画素ブロックと上隣接16画素×16画素ブロックの画素値と現ブロックの画素値を評価して決定される。ここで、評価に使用する隣接16画素×16画素ブロックの画素は再生画素であることが望ましい。再生画素は、イントラ予測やインター予測で得られた予測誤差を整数変換、量子化、逆量子化および逆整数変換し、予測値を加算することにより求められる。しかし、図48のMBパイプラインではステージ3でn−1番目のMBの整数変換等が終わり、ステージ4の動き補償でn−1番目のMBの再生画素が作成されたときには、ステージ2におけるn番目のMBのイントラ予測は終了している。このため、n番目のMBについて16画素×16画素ブロックイントラ予測の予測モード判定を行うときには、その左に隣接したn−1番目のMBの再生画素を使用することはできない。このため、左に隣接したn−1番目の16画素×16画素ブロックの予測モード判定については再生画素ではなく、符号化中の現ピクチャの画素を使用せざるを得ない。同様に、H.264における4画素×4画素ブロックイントラ予測モードでは左隣接、上隣接、右上隣接の4画素×4画素ブロックの再生画素を使用して予測モードを決定することが望ましいが、図48のMBパイプラインでは不可能であり、次善の手段として符号化中の現ピクチャの画素を使用せざるを得ない。このため、図48のMBパイプラインにより決定されるイントラ予測モードは準最適なものとなる。 (3) The 16 pixel × 16 pixel block intra prediction mode is determined by evaluating the pixel value of the left adjacent 16 pixel × 16 pixel block and the upper adjacent 16 pixel × 16 pixel block and the pixel value of the current block. Here, it is desirable that the pixels of the adjacent 16 pixel × 16 pixel block used for evaluation are reproduction pixels. The reproduced pixel is obtained by performing integer conversion, quantization, inverse quantization, and inverse integer conversion on a prediction error obtained by intra prediction or inter prediction, and adding a prediction value. However, in the MB pipeline of FIG. 48, when the integer conversion of the (n−1) th MB is completed in stage 3 and the reproduction pixel of the (n−1) th MB is created by the motion compensation in stage 4, the n in the stage 2 The intra prediction of the second MB has been completed. For this reason, when the prediction mode determination of 16 pixel × 16 pixel block intra prediction is performed for the nth MB, the reproduction pixel of the (n−1) th MB adjacent to the left cannot be used. For this reason, in the prediction mode determination of the (n−1) th 16-pixel × 16-pixel block adjacent to the left, the pixel of the current picture being encoded must be used instead of the reproduction pixel. Similarly, H.M. In the 4 pixel × 4 pixel block intra prediction mode in H.264, it is desirable to determine the prediction mode using the reproduction pixels of the 4 pixels × 4 pixel block of the left adjacent, upper adjacent, and upper right adjacent, but the MB pipeline of FIG. In this case, it is impossible to use the pixels of the current picture being encoded as a suboptimal measure. For this reason, the intra prediction mode determined by the MB pipeline in FIG. 48 is suboptimal.

(4)イントラ予測値は、符号化装置と復号装置で同一のものを使用しなければならないため、再生画素から作成せざるを得ない。一方、PピクチャとBピクチャでは、左に隣接したn−1番目のMBがインター予測モードと判定された場合には、動き補償が終わるまで再生画素が得られない。しかし、図48のMBパイプラインでは、n−1番目のMBについてのステージ4における再生画素の生成と、n番目のMBについてのステージ3における整数変換等は同時に実行される。このため、PピクチャとBピクチャでは、n−1番目のMBの再生画素を用いて予測値を作成し、n番目のMBの整数変換等を行うことは困難である。 (4) Since the same intra prediction value must be used in the encoding device and the decoding device, it must be generated from the reproduced pixels. On the other hand, in the P picture and the B picture, when the n−1th MB adjacent to the left is determined to be in the inter prediction mode, a reproduced pixel cannot be obtained until the motion compensation is completed. However, in the MB pipeline of FIG. 48, the generation of the reproduction pixel in the stage 4 for the (n-1) th MB, the integer conversion in the stage 3 for the nth MB, and the like are executed simultaneously. For this reason, in the P picture and the B picture, it is difficult to create a prediction value using the reproduction pixel of the (n-1) th MB and perform integer conversion of the nth MB.

また、ピクチャのデータ量は膨大であるため、一般にピクチャは動画像符号化装置の外部のメモリに記憶される。図49は、従来の動画像符号化装置の構成を示すブロック図である(例えば、非特許文献2のp2009、図3参照)。動きベクトル検出器106は、内部メモリ104と動き検出回路105で構成される。従来の動きベクトル検出器106では動きベクトルが存在する可能性がある領域(以下、参照領域という。)を動きベクトル検出器106の外部メモリ4から動きベクトル検出器106の内部メモリ104にコピーし、内部メモリ104内の画素に対して動きベクトルを検出するための演算が行われる。図50は、隣接する2つのMB107、108の参照領域109、110の例を示す。MB108の参照領域110はMB107の参照領域109と大部分重なっており、重なっていない領域の幅はMBの横方向の画素数と一致する。参照領域110は参照領域109より右方向にMBの横方向の画素数分ずれているだけである。以下では、このずれている領域を更新領域111と呼ぶ。従来の動きベクトル検出器106はこの性質を利用して外部メモリ4と動きベクトル検出器106の内部メモリ104間の画素転送量を削減する。外部メモリ4から内部メモリ104へは更新領域111のみ転送し、MB108の動き検出を開始するとき、参照領域の原点を参照領域109の(0,0)から参照領域110の(0,0)’に付け替える。このように、更新領域111のみ読み込んで参照領域を更新することにより外部メモリ4から内部メモリ104への転送量を削減していた。すなわち、従来は参照領域の横方向の重なりを利用して外部メモリ4と内部メモリ104の間の画素転送量を削減していた。これにより、従来の1チップMPEG−2コーデックLSIは、200MHzで動作する32ビット幅のDDR−SDRAMを2個外付けすることで1080iの動画像を符号化することが可能となった(例えば、非特許文献のpp.12-13参照)。 Also, since the amount of picture data is enormous, the picture is generally stored in a memory external to the moving picture coding apparatus. FIG. 49 is a block diagram showing a configuration of a conventional moving image encoding device (see, for example, p2009 of Non-Patent Document 2 and FIG. 3). The motion vector detector 106 includes an internal memory 104 and a motion detection circuit 105. In the conventional motion vector detector 106, a region where a motion vector may exist (hereinafter referred to as a reference region) is copied from the external memory 4 of the motion vector detector 106 to the internal memory 104 of the motion vector detector 106, An operation for detecting a motion vector is performed on the pixels in the internal memory 104. FIG. 50 shows an example of reference areas 109 and 110 of two adjacent MBs 107 and 108. The reference area 110 of the MB 108 substantially overlaps the reference area 109 of the MB 107, and the width of the non-overlapping area matches the number of pixels in the horizontal direction of the MB. The reference area 110 is only shifted from the reference area 109 to the right by the number of pixels in the horizontal direction of MB. Hereinafter, this shifted area is referred to as an update area 111. The conventional motion vector detector 106 uses this property to reduce the pixel transfer amount between the external memory 4 and the internal memory 104 of the motion vector detector 106. When only the update area 111 is transferred from the external memory 4 to the internal memory 104 and motion detection of the MB 108 is started, the origin of the reference area is changed from (0, 0) of the reference area 109 to (0, 0) ′ of the reference area 110. Replace with. As described above, the transfer amount from the external memory 4 to the internal memory 104 is reduced by reading only the update area 111 and updating the reference area. That is, conventionally, the amount of pixel transfer between the external memory 4 and the internal memory 104 has been reduced by utilizing the horizontal overlap of the reference areas. As a result, the conventional one-chip MPEG-2 codec LSI can encode a 1080i moving image by attaching two 32-bit DDR-SDRAMs operating at 200 MHz (for example, (See Non-Patent Document 3 , pp.12-13).

しかし、DCI(Digital Cinema Initiative)の定めたデジタルシネマ規格による1ピクチャの大きさは4096画素×2160画素であり、1080i(1920画素×1080画素)の4倍の画素数を有する。また、1080iの3倍を超える画素数のピクチャを1080iの2倍のレート(60枚/秒)で出力するCMOSセンサが開発されている(例えば、非特許文献のsesion 27.1参照)。最新の技術を用いれば、デジタルシネマクラスの動画像を出力するビデオカメラも実現できると予測されるところ、従来の技術を用いたのでは動画像符号化LSIに256ビット幅の入力端子を設けるか、または外部メモリを800MHz程度の速度で動作させることが必要となるという問題がある。 However, the size of one picture according to the digital cinema standard defined by DCI (Digital Cinema Initiative) is 4096 pixels × 2160 pixels, which is four times as many as 1080i (1920 pixels × 1080 pixels). In addition, a CMOS sensor has been developed that outputs a picture having a number of pixels exceeding three times that of 1080i at a rate twice that of 1080i (60 pictures / second) (for example, see section 27.1 of Non-Patent Document 4 ). If the latest technology is used, it is predicted that a video camera that outputs a moving image of a digital cinema class can be realized. If the conventional technology is used, is a moving image encoding LSI provided with a 256-bit width input terminal? There is a problem that it is necessary to operate the external memory at a speed of about 800 MHz.

また、動画像符号化装置の処理速度が遅く、1台では処理が間に合わない場合、複数の動画像符号化装置による並列処理が行われる。この場合のピクチャ分割方法として、図51に示す4種類が考えられる(例えば、非特許文献5のp.17、Figure
1参照)。すなわち、(a)横分割、(b)縦分割、(c)縦横分割、(d)スライスインタリーブである。従来は、複数の画像符号化装置間の接続やデータ転送が簡単になるという理由で(a)横分割が採用されることが多かった(例えば、非特許文献参照)。しかし、横分割し、複数の動画像符号化装置で並列処理する方法では、カメラから1ピクチャ分の画素が全て読み込まれるまで符号化開始が遅延するという問題がある。この遅延が生じることは、テレビ電話や遠隔監視等の低遅延を要求される通信アプリケーションでは望ましくない。
In addition, when the processing speed of the video encoding device is slow and the processing cannot be performed in time with one unit, parallel processing by a plurality of video encoding devices is performed. As the picture dividing method in this case, four types shown in FIG. 51 can be considered (for example, p.17 of Non-Patent Document 5, FIG.
1). That is, (a) horizontal division, (b) vertical division, (c) vertical and horizontal division, and (d) slice interleaving. Conventionally, (a) horizontal division has been often employed because connection and data transfer between a plurality of image encoding devices are simplified (see, for example, Non-Patent Document 3 ). However, the method of performing horizontal division and performing parallel processing with a plurality of moving image encoding apparatuses has a problem that the start of encoding is delayed until all pixels for one picture are read from the camera. The occurrence of this delay is undesirable in communication applications that require low delay such as videophones and remote monitoring.

また、H.264では可変長符号化を算術符号化の一種であるCABACで行うことができる。図52は、CABAC符号化器のブロック図を示す。CABACでは、まず、多値のシンタックスデータ(H.264ではシンタックスエレメントと呼ばれるが、本明細書と特許請求の範囲では、シンタックスデータという。)を2値化回路112により可変長の2値化シンボルに変換する。次に、コンテクスト計算回路113により2値化シンボル1
ビット(以下、symbolという。)ごとにコンテキスト計算を行う。そして、計算されたコンテキスト情報に応じて、算術符号化の確率テーブル115を選択し、算術符号化回路114によりsymbolを算術符号化するとともに、確率テーブル115の更新を行い、次のsymbolの算術符号化には更新された確率テーブル115を用いる。
H. In H.264, variable length coding can be performed by CABAC, which is a kind of arithmetic coding. FIG. 52 shows a block diagram of a CABAC encoder. In CABAC, first, multi-value syntax data (referred to as syntax data in H.264 but referred to as syntax data in this specification and claims) is converted to variable length 2 by a binarization circuit 112. Convert to a valued symbol. Next, the context calculation circuit 113 performs binarization symbol 1
Context calculation is performed for each bit (hereinafter referred to as symbol). Then, the arithmetic coding probability table 115 is selected according to the calculated context information, the symbol is arithmetically encoded by the arithmetic encoding circuit 114, the probability table 115 is updated, and the arithmetic symbol of the next symbol is calculated. The updated probability table 115 is used for conversion.

図53は、算術符号化回路114の処理内容を表すBiari_encode_symbol処理フローである(例えば、非特許文献参照)。CABACでは、符号化の状態をsymbol系列の存在区間の幅(以下、rangeという。)と下端(以下、lowという)で表す。rangeとlowのビット幅はそれぞれ9ビットと10ビットであり、スライスの先頭でrangeは0x1FE(0xは、16進数であることを示す。以下、同じ)、lowは0x000に初期化される。0と1のうち、発生確率の低い方がLPS(Least Probable Symbol)に割り当てられ、発生確率の高い方がMPS(Most Probable Symbol)に割り当てられる。確率テーブル115は、コンテクスト情報ごとにsymbolの発生確率を保持している。各発生確率は0または1のいずれがMPSに割り当てられているかという情報とLPSの発生確率(以下、rLPSという。)の状態を示す番号(以下、stateという。)で示され、rLPSは、stateとrangeによってテーブル(rLPS_table_64x4)を引くことにより求められる(ステップS30)。一方、MPSの発生確率は、rangeからrLPSを減算することで算出される(ステップS31)。 FIG. 53 is a Biari_encode_symbol processing flow showing the processing contents of the arithmetic encoding circuit 114 (see Non-Patent Document 6 , for example). In CABAC, the coding state is represented by the width (hereinafter referred to as “range”) and the lower end (hereinafter referred to as “low”) of the existence sequence of the symbol sequence. The bit widths of range and low are 9 bits and 10 bits, respectively, and at the head of the slice, range is initialized to 0x1FE (0x indicates a hexadecimal number, the same applies hereinafter), and low is initialized to 0x000. Of 0 and 1, the lower occurrence probability is assigned to LPS (Least Probable Symbol), and the higher occurrence probability is assigned to MPS (Most Probable Symbol). The probability table 115 holds the occurrence probability of symbol for each context information. Each occurrence probability is indicated by information indicating whether 0 or 1 is assigned to the MPS and a number (hereinafter referred to as “state”) indicating an LPS occurrence probability (hereinafter referred to as “rLPS”). And a range by subtracting a table (rLPS_table_64x4) (step S30). On the other hand, the occurrence probability of MPS is calculated by subtracting rLPS from range (step S31).

symbolがLPSであるときのrangeとlowの変化を図54(a)に示す。symbolがLPSであるとき、MPSの発生確率を加算することによってlowが更新され、rangeにはrLPSが設定される(ステップS33)。state=0であれば、次の符号化状態における0と1の発生確率の大小が逆転すると予想されるため、MPSに対応する0と1が入れ替えられる(ステップS34、S35)。そして、LPSに対応する遷移テーブル(AC_next_state_LPS_64)を引くことによって、stateの状態が更新される(ステップS36)。   FIG. 54A shows changes in range and low when symbol is LPS. When symbol is LPS, low is updated by adding the occurrence probability of MPS, and rLPS is set in range (step S33). If state = 0, the occurrence probability of 0 and 1 in the next coding state is expected to be reversed, so 0 and 1 corresponding to MPS are switched (steps S34 and S35). Then, the state of the state is updated by drawing the transition table (AC_next_state_LPS_64) corresponding to the LPS (step S36).

symbolがMPSであるときのrangeとlowの変化を図54(b)に示す。symbolがMPSであるとき、lowは変化せず、rangeにはMPSの発生確率が設定される(ステップS31)。そして、MPSに対応する遷移テーブル(AC_next_state_MPS_64)を引くことによって、stateの状態が更新される(ステップS37)。   FIG. 54B shows changes in range and low when symbol is MPS. When symbol is MPS, low does not change, and MPS occurrence probability is set in range (step S31). Then, the state of the state is updated by drawing the transition table (AC_next_state_MPS_64) corresponding to the MPS (step S37).

range<0x100のときには、再正規化が行われ、rangeとlowが拡大される(ステップS38)。再正規化により、rangeの範囲は、0x100≦range≦0x1FEとなる。   When range <0x100, renormalization is performed, and range and low are expanded (step S38). Due to renormalization, the range of range becomes 0x100 ≦ range ≦ 0x1FE.

このように、symbolごとに算術符号化せざるを得えず、処理サイクル数がかかるにもかかわらず、1つのスライス内では1個の確率テーブル115しか使用できない。このため、算術符号化器114は原理的に並列化できない。   In this way, arithmetic coding must be performed for each symbol, and only one probability table 115 can be used in one slice despite the number of processing cycles. For this reason, the arithmetic encoder 114 cannot be parallelized in principle.

更に、IピクチャにはPピクチャやBピクチャに比べて多くの符号量が配分される。このため、ピクチャ全体の2値化シンボルの平均発生量に比べてIピクチャの2値化シンボルの発生量は多い。その上、急激に発生符号量が増加したとき、レート制御が破綻することを防ぐためにMBごとの発生符号量を早期にレート制御に反映させる必要がある。このように、算術符号化回路114には、処理サイクル数がかかるにもかかわらず、並列化が不可能で、しかも発生符号量の多いIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できるだけの性能が必要となるという問題がある。   Furthermore, a larger amount of code is allocated to the I picture than to the P picture and the B picture. For this reason, the amount of occurrence of binarized symbols in the I picture is larger than the average amount of binarized symbols in the entire picture. In addition, when the generated code amount suddenly increases, the generated code amount for each MB needs to be reflected in the rate control at an early stage in order to prevent the rate control from failing. In this way, the arithmetic coding circuit 114 is able to reduce the amount of binarized symbols generated suddenly in an I picture that cannot be parallelized and has a large amount of generated codes, despite the number of processing cycles. There is a problem that performance sufficient for processing is required.

なお、CABACに関して実際の算術符号化は行わずに2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定する方法が提案されている(例えば、非特許文献のp.20、図6参照)。具体的には、2値化シンボル長N
と直前の符号化済みピクチャの2値化シンボル長と発生符号量との比率αを用いて、発生符号量R=α×Nと推定するものである。ルックアップテーブルを用いれば多値のシンタックスデータを2値化シンボルに1CKで変換することが可能であるため、この方法を用いれば算術符号化の発生符号量の推定をシンタックスデータ当たり1CKで行うことができる。
渡辺浩巳,茶木英明,”H.264とMPEG-4に両対応 携帯機器向けコーデック・コアを開発 VGAの動画を36mAで符号化”,日経エレクトロニクス,2004年9月27日号,no.883,pp123-133. 南俊宏,長沼次郎,“テレスコピック探索に適した動きベクトル検出器構成法の提案”,信学論(D−2),vol.J87-D-2,no.11,pp.2007-2024,Nov.2004. 長沼次郎,岩崎裕江,新田高庸,中村健,吉留健,小倉充雄,中島靖之,田代豊,大西隆之,池田充郎,遠藤真,八島由幸,“1チップHDTV MPEG-2 CODEC LSI構成技術――VASA”,NTT技術ジャーナル,vol.15,No.9,pp.12-15,2003年9月. S. Yoshihara, M.Kikuchi, Y. Ito, Y. Inada, S. Kuramochi, H.Wakabayashi, M. Okano, K. Koseki, H. Kuriyama, J. Inutsuka, A. Tajima,T. Nakajima, Y.Kudoh, F. Koga, Y. Kasagi,S. Watanabe, T. Nomoto, “A 1/1.8-inch 6.4MPixel 60frames/s CMOS Image Sensorwith Seamless Mode Change”, ISSCC2006, session 27.1, Feb. 2006. 野垣智士,“MPEG−2 MP@HLエンコーダにおける符号化制御方式の検討”,PCSJ98,P-2.04,pp.17-18,1998年10月. H.264/AVC reference software ( JM 10.2 ). 山影朋夫,中條健,古藤 晋一郎,” HD DVD に用いる動画像符号化技術“,東芝レビュー,vol.60,No.1,pp.17-29,2005.
The method for estimating the amount of code generated arithmetic coding has been proposed from the actual arithmetic coding sum of symbol length of the binary symbols without regard to CABAC (e.g., p.20 Non-Patent Document 7 FIG. 6). Specifically, binarized symbol length N
The generated code amount R = α × N is estimated using the ratio α between the binary symbol length of the immediately previous encoded picture and the generated code amount. Since it is possible to convert multi-level syntax data into binarized symbols with 1 CK using a lookup table, this method can be used to estimate the amount of code generated by arithmetic coding at 1 CK per syntax data. It can be carried out.
Hiroaki Watanabe, Hideaki Chaki, “Developed codec core for mobile devices compatible with both H.264 and MPEG-4, encoded VGA video with 36 mA”, Nikkei Electronics, September 27, 2004, no.883, pp123-133. Toshihiro Minami and Jiro Naganuma, “Proposal of Motion Vector Detector Configuration Suitable for Telescopic Search”, Theory of Science (D-2), vol.J87-D-2, no.11, pp.2007-2024, Nov .2004. Jiro Naganuma, Hiroe Iwasaki, Takahiro Nitta, Ken Nakamura, Ken Yoshidome, Mitsuo Ogura, Yasuyuki Nakajima, Yutaka Tashiro, Takayuki Onishi, Mitsuru Ikeda, Makoto Endo, Yoshiyuki Yashima, “One-chip HDTV MPEG-2 CODEC LSI Configuration Technology— VASA ", NTT Technical Journal, vol.15, No.9, pp.12-15, September 2003. S. Yoshihara, M. Kikuchi, Y. Ito, Y. Inada, S. Kuramochi, H. Wakabayashi, M. Okano, K. Koseki, H. Kuriyama, J. Inutsuka, A. Tajima, T. Nakajima, Y. Kudoh, F. Koga, Y. Kasagi, S. Watanabe, T. Nomoto, “A 1 / 1.8-inch 6.4MPixel 60frames / s CMOS Image Sensor with Seamless Mode Change”, ISSCC2006, session 27.1, Feb. 2006. Satoshi Nogaki, “Examination of coding control method in MPEG-2 MP @ HL encoder”, PCSJ98, P-2.04, pp.17-18, October 1998. H.264 / AVC reference software (JM 10.2). Ikuo Yamakage, Takeshi Nakajo, Shinichiro Furuto, “Video coding technology for HD DVD”, Toshiba Review, vol.60, No.1, pp.17-29, 2005.

本発明は上記事情に鑑み、MBパイプライン構造の動画像符号化装置において、隣接ブロックの処理結果を符号化中のブロックの処理にフィードバック可能とすることを目的とする。具体的には、左隣接MBの発生符号量に応じて現MBをレート制御すること、隣接ブロックの動きベクトルの符号量を考慮して符号化中のブロックの動きベクトルを検出すること、左隣接MBのイントラ予測/インター予測判定結果を考慮して符号化中のブロックの動きベクトルを検出すること、隣接ブロックの再生画素を用いてイントラ予測モードを決定すること、およびPピクチャとBピクチャで左隣接MBの再生画素を用いて予測値を作成してイントラ予測を行うことを目的とする。   In view of the above circumstances, an object of the present invention is to enable feedback of the processing result of an adjacent block to the processing of a block being encoded in a moving picture encoding apparatus having an MB pipeline structure. Specifically, rate control of the current MB according to the generated code amount of the left adjacent MB, detection of the motion vector of the block being encoded in consideration of the code amount of the motion vector of the adjacent block, left adjacent Detecting the motion vector of the block being encoded in consideration of the MB intra prediction / inter prediction determination result, determining the intra prediction mode using the reproduced pixels of the adjacent block, and left P picture and B picture An object of the present invention is to perform intra prediction by creating a prediction value using a reproduction pixel of an adjacent MB.

また、本発明は、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる動画像符号化装置を提供することを目的とする。   It is another object of the present invention to provide a moving picture coding apparatus that can reduce the amount of data transferred from an external memory that stores pictures to the internal memory of the moving picture coding apparatus.

更に、本発明は、並列動作するときでも符号化に要する遅延が小さい画像符号化装置を提供することを目的とする。 Furthermore, an object of the present invention is to provide an image encoding apparatus that has a small delay required for encoding even when operating in parallel .

また、本発明は、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化可能とすることを目的とする。   It is another object of the present invention to enable arithmetic coding even when the arithmetic coding circuit does not have a performance sufficient to handle a binarized symbol generation amount that suddenly increases.

本発明の動画像符号化装置は、縦に連続する少なくても2行のマクロブロック行をひとまとまりとして符号化を行う動画像符号化装置であって、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを有し、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックが前記マクロブロックパイプラインに投入されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始し、上に隣接したマクロブロック行に含まれるマクロブロックの符号化が開始されてから1マクロブロックサイクル後に、下に隣接したマクロブロック行に含まれるマクロブロックであって、前記上に隣接したマクロブロック行に含まれるマクロブロックより左方向に1マクロブロック以上離れているマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで繰り返される。The moving picture coding apparatus according to the present invention is a moving picture coding apparatus that performs coding with a group of at least two macroblock rows that are continuous vertically, and performs a plurality of stages of moving picture coding processing. When the macroblock included in the uppermost macroblock row in the group of macroblock rows is input to the macroblock pipeline, the macroblock pipe A macroblock included in a lower adjacent macroblock row one line after a line starts encoding the macroblock and starts encoding a macroblock included in the upper adjacent macroblock row And one macroblock in the left direction from the macroblock included in the macroblock row adjacent above. The macroblocks that are separated from each other are input to the macroblock pipeline, and the macroblock pipeline starts encoding the macroblock. It repeats from the macroblock line to the bottom macroblock line.

また、本発明の動画像符号化装置は、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインと、縦に連続するm(mは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択するマクロブロック選択部と、前記マクロブロック選択部によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記マクロブロックパイプラインに設定する符号化データ設定部とを有し、前記符号化データ設定部によってマクロブロックを符号化するために必要な前記データが設定されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始し、前記符号化データ設定部によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要な前記データが前記マクロブロックパイプラインに設定されると、前記マクロブロック選択部が前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択する。 In addition, the moving picture coding apparatus according to the present invention includes a macroblock pipeline that performs moving picture coding divided into a plurality of stages, and a macroblock of m rows (m is an integer of 2 or more) that are vertically continuous. For a macroblock belonging to the uppermost macroblock row in the group of macroblock rows, a macroblock for which the lower left adjacent macroblock has not yet been selected is selected, and the batch is selected. For macroblocks belonging to a macroblock row other than the topmost macroblock row, a macroblock included in the group of macroblock rows is selected by selecting a macroblock in which the upper right adjacent macroblock is already selected. and the macro block selector for selecting one per macroblock row block, the Ma For each macroblock selected by the B block selection unit, wherein the uppermost macroblocks belonging to the macro block rows in the macroblock row of batches and to the macroblock belonging to the macroblock line of the lowest, m macro An encoded data setting unit for setting data necessary for encoding individual macroblocks in each macroblock cycle in the macroblock pipeline in order over the block cycle, and setting the encoded data When the data necessary for encoding the macroblock is set by the unit, the macroblock pipeline starts encoding the macroblock, and the group of macroblock rows is started by the encoded data setting unit . Mac belonging to the bottom macroblock line in If the data needed to encode the block is set to the macro block pipeline, newly selects the right neighboring macroblocks for each individual macroblock the macroblock selector is the selected .

また、本発明の動画像符号化装置は、縦に連続する2n行(nは2以上の整数)のマクロブロック行をひとまとまりとし、縦に隣接する2個のマクロブロックを組み合わせてマクロブロックペアとしてマクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置であって、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを有し、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入されると、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始し、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックの片方の符号化が開始されてから1マクロブロックサイクル後に、下に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックであって、前記上に隣接した2行のマクロブロック行に属するマクロブロックペアより左方向に1マクロブロック以上離れているマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで繰り返され、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックのうち最初に符号化を開始されなかった他の片方のマクロブロックが前記マクロブロックパイプラインに投入されると、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始し、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる他の片方のマクロブロックの符号化が開始されてから1マクロブロックサイクル後に、下に隣接した2行のマクロブロック行に属するマクロブロックペアであって、前記上に隣接した2行のマクロブロック行に属するマクロブロックペアより左方向に1マクロブロック以上離れている前記マクロブロックペアに含まれるマクロブロックのうち最初に符号化を開始されなかった他の片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで繰り返される。In addition, the moving picture encoding apparatus of the present invention collects macro block rows of 2n rows (where n is an integer equal to or greater than 2) as a group, and combines two adjacent macro blocks vertically to form a macro block pair. Is a moving picture coding apparatus that performs coding by switching between field coding and frame coding for each macroblock pair, and has a macroblock pipeline that divides moving picture coding processing into a plurality of stages. When one macroblock included in a macroblock pair belonging to the top two macroblock rows in the group of macroblock rows is input to the macroblock pipeline, the macroblock pipe The line starts encoding one of the macroblocks, and the macros belonging to the two adjacent macroblock rows are One macroblock included in a macroblock pair belonging to two adjacent macroblock rows after one macroblock cycle after the encoding of one of the macroblocks included in the block pair is started, One macroblock included in a macroblock pair that is one macroblock or more leftward from the macroblock pair belonging to the two adjacent macroblock rows is input to the macroblock pipeline, and the macroblock When the pipeline starts to encode one of the macroblocks, the macros in the two rows located at the bottom of the third and fourth macroblock rows from the top of the group of macroblock rows. It repeats to the block line, and is positioned at the top of the group of macro block lines. When the other one of the macroblocks that is not first encoded among the macroblocks included in the macroblock pair belonging to the two macroblock rows is input to the macroblock pipeline, the macroblock pipe One line after the line starts encoding the other one macroblock and the other one macroblock included in the macroblock pair belonging to the two adjacent macroblock rows starts encoding. After a block cycle, a macroblock pair belonging to the two adjacent macroblock rows below the macroblock pair belonging to the two adjacent macroblock rows above is left one macroblock or more in the left direction Encoding is not started first among the macroblocks included in the macroblock pair The other macroblock is put into the macroblock pipeline, and the macroblock pipeline starts encoding the other macroblock. Are repeated from the third and fourth macroblock rows to the two lowermost macroblock rows.

また、本発明の動画像符号化装置は、縦に隣接する2のマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置であって、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインと、縦に連続する2n(nは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペアを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペアを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペアを2マクロブロック行当たり1個選択するマクロブロックペア選択部と、前記マクロブロックペア選択部によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロックを構成し、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックを構成し、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロックを構成し、マクロブロックペアの下半分のラインで下フレームマクロブロックを構成するフィールドマクロブロックペア・フレームマクロブロックペア構成部と、前記マクロブロックペア選択部によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータを前記マクロブロックパイプラインに設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち最初に設定されなかった他の片方を符号化するために必要なデータを前記マクロブロックパイプラインに設定し、一方、フレーム符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータを前記マクロブロックパイプラインに設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータを前記マクロブロックパイプラインに設定する符号化データ設定部とを有し、前記符号化データ設定部によってマクロブロックを符号化するために必要な前記データが設定されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始し、前記符号化データ設定部によって、2回目に、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記マクロブロックパイプラインに設定されると、前記マクロブロックペア選択部が前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペアを新たに選択する。 The moving picture encoding apparatus of the present invention, a macroblock pair combines the two macro blocks adjacent to the vertical, video encoding for encoding by switching the field coding and frame coding for each macroblock pair A macroblock pipeline that divides a video encoding process into a plurality of stages, and 2n rows (n is an integer greater than or equal to 2) macroblock rows as a group, wherein the most located on belonging to the macroblock line of the two rows macroblock pair in a macroblock line of human settlement, select the macroblock pair is the lower left neighboring macroblock pair is not already selected, and the macroblock pair belonging to the uppermost macroblock lines except two rows located in the macroblock row of human unity For, by selecting a macroblock pair that upper-right neighboring macroblock pair is already selected, the selection macroblock pair to select one per 2 macro block row macroblock pairs in the macroblocks line of human unity and parts, the macroblock pair selected by the macroblock pair selection unit, when the field coding is selected, the odd lines of the macroblock pair constitutes a top field macroblock, even lines of the macroblock pair When a bottom field macroblock is configured and frame coding is selected, the upper frame macroblock is configured with the upper half line of the macroblock pair, and the lower frame macroblock is configured with the lower half line of the macroblock pair. feel that A macroblock pair frame macroblock pair forming unit, the macroblock pair selected by the macroblock pair selection unit, when the field coding is selected, first, in a macro-block row of the human unity most from the macroblock pairs belonging to the macroblock row of two rows located above, until macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of the human unity, n macroblocks cycle In order, the data necessary for encoding one of the macroblocks included in each macroblock pair for each macroblock cycle is set in the macroblock pipeline , and the batch of The top two macros in the macro block line From the macroblock pairs belonging to the block row, until said macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of batches and sequentially over n macroblocks cycle, one macro block cycle For each of the macroblocks included in each macroblock pair, data necessary to encode the other one that was not initially set is set in the macroblock pipeline , while frame encoding is selected. when the initially from said uppermost belonging to the macroblock row of two rows located macroblock pair in the macroblock row of batches and located at the bottom in the macro-block row of the human unity until macroblock pairs belonging to the macro block rows in two rows, n macroblocks cycle Sequentially over, set the data required to encode the upper frame macroblocks contained in each macroblock pair for each macroblock cycle the macroblock pipeline, the second time, the human unity From the macroblock pair belonging to the two macroblock rows located at the top in the macroblock row, the macroblock pair belonging to the two macroblock rows located at the bottom in the group of macroblock rows until, in turn over n macroblocks cycle, the coded data for setting data required for encoding the lower frame macroblocks contained in each macroblock pair for each macroblock cycle the macroblock pipeline and a setting unit, macro by the encoded data setting unit When the data is set needed to encode the block, the macro block pipeline starts encoding of the macroblock by the encoded data setting unit, the second time, the macro of the human unity When data necessary for encoding a macroblock included in a macroblock pair belonging to the two macroblock rows located at the bottom of the block row is set in the macroblock pipeline , the macroblock The pair selection unit newly selects the right adjacent macroblock pair for each of the selected individual macroblock pairs.

好ましくは、本発明の動画像符号化装置は、前記マクロブロックパイプラインにおける一部のステージで、マクロブロックサイクルがサブブロックサイクルに分割されてサブブロックパイプラインが形成され、サブブロックごとの処理が行われる。 Preferably, in the moving picture coding apparatus according to the present invention, at some stages in the macroblock pipeline , the macroblock cycle is divided into subblock cycles to form a subblock pipeline , and processing for each subblock is performed. Done.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを、各マクロブロック行当たり1個符号化するために必要な全てのデータを記憶する内部メモリを有する。Preferably, the moving picture encoding apparatus of the present invention has an internal memory for storing all data necessary for encoding one macroblock included in the group of macroblock rows for each macroblock row. Have.

好ましくは、本発明の動画像符号化装置は、請求項1から請求項までのいずれか1項に記載された少なくても2台の前記動画像符号化装置を含む動画像符号化装置であって、ピクチャが前記ひとまとまりのマクロブロック行ごとに分割され、この分割された分割領域ごとに個々の前記動画像符号化装置が割り当てられ、縦に連続した分割領域が少なくても2台の前記動画像符号化装置によって並列に符号化される。 Preferably, the video encoding apparatus of the present invention is a video encoding apparatus including the moving picture coding apparatus of two even less as described in any one of claims 1 to 6 Thus, a picture is divided into a group of macroblock rows, and each moving image encoding device is assigned to each of the divided divided areas, and at least two vertically divided divided areas are provided . It is encoded in parallel by the moving picture coding apparatus.

好ましくは、本発明の動画像符号化装置は、シンタックスデータを2値化シンボルに変換する2値化と、前記2値化シンボルを記憶する2値化シンボル記憶と、前記2値化シンボル記憶から読み出した2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元と、前記2値化シンボル記憶から読み出した2値化シンボルを、前記コンテクスト情報復元により復元されたコンテクスト情報に基づいて算術符号化する算術符号化を有する。 Preferably, the moving picture coding apparatus according to the present invention includes a binarization unit that converts syntax data into a binarized symbol, a binarized symbol storage unit that stores the binarized symbol, and the binarization. A context information restoration unit that restores context information corresponding to the binarized symbol read from the symbol storage unit; and a context in which the binary symbol read from the binarized symbol storage unit is restored by the context information restoration unit An arithmetic encoding unit that performs arithmetic encoding based on the information .

好ましくは、本発明の動画像符号化装置は、前記2値化により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化部を有する。 Preferably, the moving image encoding apparatus of the present invention includes a provisional arithmetic encoding unit that calculates provisionally generated code amount by provisionally arithmetically encoding the binarized symbols converted by the binarization unit .

好ましくは、本発明の動画像符号化装置は、シンタックスデータを可逆圧縮するシンタックスデータ圧縮と、前記シンタックスデータ圧縮により圧縮されたシンタックスデータを記憶する圧縮シンタックスデータ記憶と、前記圧縮シンタックスデータ記憶から前記圧縮されたシンタックスデータを読み出して前記シンタックスデータを復元するシンタックスデータ復元と、前記シンタックスデータ復元により復元された前記シンタックスデータを2値化シンボルに変換する2値化と、前記2値化によって変換された2値化シンボルを算術符号化する算術符号化を有する。 Preferably, the moving image encoding apparatus of the present invention includes a syntax data compression unit that reversibly compresses syntax data, and a compression syntax data storage unit that stores syntax data compressed by the syntax data compression unit. , the compressed syntax data from the storage unit and the syntax data restoration unit for restoring the syntax data by reading the syntax data said compressed, the syntax data recovery restored the syntax data binary by section has a binarization unit for converting the encoded symbols, the arithmetic coding unit arithmetically codes the binary symbol which has been converted by the binarization unit.

好ましくは、本発明の動画像符号化装置は、前記シンタックスデータ圧縮部が、前記シンタックスデータをCAVLCで圧縮する。Preferably, in the moving image encoding apparatus of the present invention, the syntax data compression unit compresses the syntax data by CAVLC.

また、本発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを含み、縦に連続する少なくても2行のマクロブロック行をひとまとまりとして符号化を行う動画像符号化装置における動画像符号化方法であって、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックが前記マクロブロックパイプラインに投入されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始するステップと、上に隣接したマクロブロック行に含まれるマクロブロックの符号化が開始されてから1マクロブロックサイクル後に、下に隣接したマクロブロック行に含まれるマクロブロックであって、前記上に隣接したマクロブロック行に含まれるマクロブロックより左方向に1マクロブロック以上離れているマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで繰り返されるステップとを有する。In addition, the moving picture coding method of the present invention includes a macroblock pipeline that performs a moving picture coding process divided into a plurality of stages, and collects at least two macroblock rows that are vertically continuous. As a moving picture coding method in a moving picture coding apparatus that performs coding as described above, a macroblock included in an uppermost macroblock row in the group of macroblock rows is input to the macroblock pipeline. Then, the macroblock pipeline starts encoding the corresponding macroblock, and the macroblock included in the macroblock row adjacent above is started one macroblock cycle after the start of encoding of the macroblock. Macroblocks included in a macroblock row that are included in the adjacent macroblock row above When a macroblock that is one macroblock or more leftward from the macroblock is input to the macroblock pipeline, and the macroblock pipeline starts encoding the macroblock, the group of macroblock rows Repeating from the second macroblock row from the top to the bottommost macroblock row.

また、本発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを含む動画像符号化装置における動画像符号化方法であって、縦に連続するm(mは2以上の整数)のマクロブロック行ひとまとまりとされ、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロック選択され、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロック選択されることによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロック1マクロブロック行当たり1個選択される第1のステップと、前記第1のステップによって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータ前記マクロブロックパイプラインに設定される第2のステップと、前記第2のステップによってマクロブロックを符号化するために必要な前記データが設定されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始する第3のステップと、前記第2のステップによって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要なデータが前記マクロブロックパイプラインに設定されると、前記第1のステップに戻り、前記選択されている個々のマクロブロックごとにその右隣接マクロブロック新たに選択され第4のステップとを有する。 A moving picture coding method according to the present invention is a moving picture coding method in a moving picture coding apparatus including a macroblock pipeline that performs a moving picture coding process divided into a plurality of stages. A macro block row of continuous m rows (m is an integer of 2 or more) is grouped, and for the macro block belonging to the uppermost macro block row in the group of macro block rows, the lower left adjacent macro block is is still selected macroblock is not selected, and the for a macroblock most belonging to the macroblock row other than the above in the macroblock row of human unity, it macroblock upper right neighboring macroblocks have already been selected by Rukoto selected, macroblock 1 macros in the macro block row of the human unity A first step that will be selected per one row lock, for each macroblock selected by the first step, from the macroblock belonging to the most macroblock row of the upper in a macroblock row of the human unity until the macro blocks belonging to a macroblock line of the lowest, in order, over a period of m macro block cycle, the data required to encode each macroblock for each macroblock cycle is set to the macro block pipeline And a third step in which the macroblock pipeline starts encoding the macroblock when the data necessary for encoding the macroblock is set by the second step. If, macroblock of the human unity by said second step When data necessary for most coding the macroblocks belonging to the macroblock line below in the click row is set to the macro block pipeline, it returns to the first step, being said selected and a fourth step of the right adjacent macroblock for each individual macroblock Ru newly selected.

また、本発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを含み、縦に連続する2n行(nは2以上の整数)のマクロブロック行をひとまとまりとし、縦に隣接する2個のマクロブロックを組み合わせてマクロブロックペアとしてマクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置における動画像符号化方法であって、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始するステップと、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックの片方の符号化が開始されてから1マクロブロックサイクル後に、下に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックであって、前記上に隣接した2行のマクロブロック行に属するマクロブロックペアより左方向に1マクロブロック以上離れているマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで繰り返されるステップと、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックのうち最初に符号化を開始されなかった他の片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始するステップと、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックの符号化が開始されてから1マクロブロックサイクル後に、下に隣接した2行のマクロブロック行に属するマクロブロックペアであって、前記上に隣接した2行のマクロブロック行に属するマクロブロックペアより左方向に1マクロブロック以上離れている前記マクロブロックペアに含まれるマクロブロックのうち最初に符号化を開始されなかった他の片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始することが、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで繰り返されるステップとを有する。In addition, the moving picture coding method of the present invention includes a macroblock pipeline in which the moving picture coding process is divided into a plurality of stages. A moving picture code in a moving picture coding apparatus that performs coding by switching between field coding and frame coding for each macro block pair by combining two macro blocks vertically adjacent to each other as a group of block rows. A macroblock included in a macroblock pair belonging to the top two macroblock rows of the group of macroblock rows is input to the macroblock pipeline, The macroblock pipeline starts encoding one of the macroblocks and adjacent to the top One of the macroblocks included in the macroblock pair belonging to the macroblock row of the row, and one of the macroblocks included in the macroblock pair belonging to the two adjacent macroblock rows after one macroblock cycle from the start of encoding One macroblock included in a macroblock pair that is one macroblock or more leftward from a macroblock pair belonging to two macroblock rows adjacent to each other on the macroblock pipeline. When the macroblock pipeline starts encoding one of the macroblocks, the third and fourth macroblock rows from the top of the group of macroblock rows are the lowest. Repeating the steps up to two macroblock rows located at The other one of the macroblocks not encoded first among the macroblocks included in the macroblock pair belonging to the top two macroblock rows in the group of macroblock rows is the macroblock. A step of starting the encoding of the other macroblock by the macroblock pipeline, and one macroblock included in a macroblock pair belonging to the two adjacent macroblock rows; After one macroblock cycle from the start of encoding, a macroblock pair belonging to the two adjacent macroblock rows below the macroblock pair belonging to the two adjacent macroblock rows above Included in the macroblock pair that is one macroblock or more away in the left direction The other one of the macroblocks that has not been encoded first is input to the macroblock pipeline, and the macroblock pipeline starts to encode the other macroblock. , And a step repeated from the top of the group of macroblock rows to the third and fourth macroblock rows located at the bottom from the fourth macroblock row.

また、本発明の動画像符号化方法は、動画像符号化の処理を複数のステージに分割して行うマクロブロックパイプラインを含み、縦に隣接する2のマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置における動画像符号化方法であって、縦に連続する2n(nは2以上の整数)のマクロブロック行ひとまとまりとされ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペア選択され、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペア選択されることによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペア2マクロブロック行当たり1個選択される第1のステップと、前記第1のステップによって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロック構成され、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックが構成され、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロック構成され、マクロブロックペアの下半分のラインで下フレームマクロブロック構成される第2のステップと、前記第1のステップによって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータ前記マクロブロックパイプラインに設定され、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータ前記マクロブロックパイプラインに設定される第3のステップと、前記第1のステップによって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち前記第3のステップにより設定されなかった他の片方を符号化するために必要なデータ前記マクロブロックパイプラインに設定され、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2のマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータ前記マクロブロックパイプラインに設定される第4のステップと、前記第3のステップまたは前記第4のステップによってマクロブロックを符号化するために必要な前記データが設定されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始する第5のステップと、前記第4のステップによって前記ひとまとまりのマクロブロック行の中の最も下に位置する2のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記マクロブロックパイプラインに設定されると、前記第1のステップに戻り、前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペア新たに選択される第6のステップとを有する。 The moving picture coding method of the present invention includes a macroblock pipeline performed by dividing the process of the moving picture coding in a plurality of stages, vertically combines the two macro blocks adjacent to the macroblock pair A moving picture coding method in a moving picture coding apparatus that switches between field coding and frame coding for each macroblock pair, and is a macro of 2n rows (n is an integer of 2 or more) that are vertically continuous. block row is a human settlement, the the most belonging to the macroblock row of two rows located above macroblock pair in a macroblock line of human chunks, macroblocks lower left neighboring macroblock pair has not yet been selected pair is selected and macroblock other than two rows located uppermost in the macro block row of the human unity Tsu For macroblock pairs belonging to click the row, by Rukoto macroblock pair to the upper right neighboring macroblock pair is already selected is selected, the macroblock pair is 2 macroblock rows in the macroblock row of human unity a first step that will be selected per one, for the first macroblock pair elected by the step, when the field coding is selected, the top field macroblock in the odd lines of the macroblock pair There is constructed, the bottom field macroblock even lines of the macroblock pair is a configuration, when the frame coding is selected, the upper frame macroblock is composed of the upper half of the macroblock pair line, a macroblock pair Lower frame macro bro with lower half line A second step of click is Ru is configured, for the first macroblock pair selected by the step, when the field coding is selected, located uppermost in the macro block row of the human unity from the macroblock pairs belonging to the macro block rows in two rows, until said macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of batches and sequentially over n macroblocks cycle, 1 macro data required to encode the one of the macroblocks contained in each macroblock pair for each block cycle is set to the macro block pipeline, whereas, when frame coding is selected, the the most macroblock row of the two rows located above in the macroblock row of human unity From belonging macroblock pair, until said macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of batches and sequentially over n macroblocks cycle, every macroblock cycle a third step and the first macroblock pair selected by step data necessary Ru is set to the macro block pipeline to encode the upper frame macroblocks contained in each macroblock pair , when the field coding is selected, from said uppermost belonging to the macroblock row of two rows located macroblock pair in the macroblock row of batches and most in the macro block row of the human unity Makuroburo belonging to the macroblock row of two rows located below Until Kupea, sequentially over n macroblocks cycle, required to encode the other one that has not been set by the third step of the macro blocks included in each macroblock pair for each macroblock cycle such data is set to the macro block pipeline, whereas, when frame coding is selected, most belong to the macro-block row of two rows located above macroblock pair in a macroblock line of the human unity from until said macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of batches and sequentially over n macroblocks cycles, each macroblock pair for each macroblock cycle Necessary to encode lower frame macroblock contained in A fourth step of data Ru is set to the macro block pipeline, when the data is set needed to encode the macroblock by the third step or the fourth step, the macro-block fifth step and said fourth step by macroblock pair most belonging to the macroblock row of two rows located below in the macroblock row of the human unity pipeline starts encoding of the macroblock When the data necessary for encoding the macroblock included in the macroblock pipeline is set in the macroblock pipeline , the process returns to the first step , and the right adjacent macro is selected for each selected macroblock pair. And a sixth step in which the block pair is newly selected .

本発明によれば、縦に連続するm(mは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択されたm個のMBを1個のMBパイプラインに連続して投入するので、左隣接MBの処理結果を(m−1)ステージ分現MBの処理にフィードバックできる。また、選択されたm個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。 According to the present invention , m MB rows (m is an integer of 2 or more) that are vertically continuous are taken as a group, and one MB is selected per MB row from the group of MB rows, and these selections are made. Since the m MBs are continuously input to one MB pipeline, the processing result of the left adjacent MB can be fed back to the processing of the (m−1) stage fractional MB. In addition, since the reference areas of the selected m MBs are largely overlapped, if the reference area of these MBs is stored in the common reference area memory, the external memory storing the pictures There is no need to duplicate transfer for updating the overlapped portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

また、本発明によれば、縦に連続する2n(nは2以上の整数)のMB行をひとまとまりとして、これらひとまとまりのMB行から、縦に連続する2つのMB行当たり1つのMBペアを選択し、最初に、これら選択されたn個のMBペアに含まれる片方のMBを1個のMBパイプラインに連続して投入し、2回目に、これら選択されたn個のMBペアに含まれる残りの片方のMBを1個のMBパイプラインに連続して投入するので、最初に投入する片方のMBの処理結果を(n−1)ステージ分残りの片方のMBの処理にフィードバックでき、かつ、左隣接MBペアの処理結果を(n−1)ステージ分現MBペアの処理にフィードバックできる。また、前記選択された2n個のMBの参照領域は大きく重なっているので、これらのMBの参照領域を共通の参照領域用メモリに記憶する構成とすれば、ピクチャを記憶している外部メモリから、この重なり部分を更新するための転送を重複して行う必要がなくなる。このため、動画像符号化装置の内部に参照領域用メモリを設けることにより、ピクチャを記憶している外部メモリから動画像符号化装置の内部メモリへのデータ転送量を削減できる。 In addition, according to the present invention , 2n (n is an integer of 2 or more) MB rows that are vertically continuous are taken as a group, and one MB pair per two MB rows that are vertically continuous from these MB rows. First, one MB included in the selected n MB pairs is continuously input to one MB pipeline, and the second time, the selected n MB pairs are transferred to the selected n MB pairs. Since the remaining one of the included MBs is continuously input to one MB pipeline, the processing result of the first MB to be input can be fed back to the processing of the remaining one MB for (n-1) stages. In addition, the processing result of the left adjacent MB pair can be fed back to the processing of the (n−1) stage partial MB pair. Further, since the reference areas of the selected 2n MBs are largely overlapped with each other, if the reference areas of these MBs are stored in a common reference area memory, the external memory storing the pictures This eliminates the need for duplicate transfer for updating the overlapping portion. For this reason, by providing the reference area memory inside the moving picture coding apparatus, the amount of data transferred from the external memory storing the picture to the internal memory of the moving picture coding apparatus can be reduced.

更に、本発明によれば、マクロブロックパイプラインの一部のステージで、マクロブロックサイクルをサブブロックサイクルに分割してサブブロックパイプラインを形成し、サブブロックごとの処理を行うことができる。このため、隣接サブブロックの処理結果を符号化中のサブブロックの処理にフィードバックとすることも可能となる。 Furthermore, according to the present invention , at some stages of the macroblock pipeline, the macroblock cycle can be divided into subblock cycles to form a subblock pipeline, and processing for each subblock can be performed. For this reason, it becomes possible to feed back the processing result of the adjacent sub-block to the processing of the sub-block being encoded.

また、本発明によれば、並列動作する複数台の動画像符号化装置の参照領域は縦に大きく重なっているので、外部メモリから並列動作する動画像符号化装置の共通内部メモリへ全ての動画像符号化装置の参照領域を転送し、共通内部メモリから個々の動画像符号化装置に転送する構成とすれば、参照領域の重なり部分を重複して転送する必要がなくなる。このため、並列動作する動画像符号化装置に共通内部メモリを設けることにより、ピクチャを記憶している外部メモリから並列動作する動画像符号化装置の共通内部メモリへのデータ転送量を削減できる。また、従来のスライスインタリーブと異なり、並列動作する動画像符号化装置が分担して符号化する領域ごとにスライス分割する必要はなく、ピクチャ全体を1スライスとすることも可能である。更に、複数台の動画像符号化装置が処理するピクチャの最初の領域が入力されると、動画像符号化装置は符号化を開始することができるので、符号化遅延を抑えることができる。 In addition, according to the present invention , since the reference areas of a plurality of video encoding devices that operate in parallel overlap each other vertically, all moving images are transferred from the external memory to the common internal memory of the video encoding device that operates in parallel. If the reference region of the image coding device is transferred and transferred from the common internal memory to each moving image coding device, there is no need to transfer overlapping portions of the reference region. For this reason, by providing a common internal memory in a moving image encoding apparatus that operates in parallel, the amount of data transferred from an external memory that stores pictures to the common internal memory of the moving image encoding apparatus that operates in parallel can be reduced. Further, unlike the conventional slice interleaving, it is not necessary to divide the slices into areas that are shared and encoded by the moving picture coding apparatuses operating in parallel , and the entire picture can be made into one slice. Furthermore, when the first region of a picture to be processed by a plurality of moving image encoding devices is input, the moving image encoding device can start encoding, and thus encoding delay can be suppressed.

更に、本発明によれば、H.264で規定されるCABAC等の算術符号化を行う場合であっても、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行うことができる。このため、あるMBの発生符号量が突発的に増加した場合に、次に符号化するMBの量子化パラメータを早急に大きくし、新たに符号化するMBから発生する符号量を減少させるようにレート制御することができる。また、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができる。特に、2値化シンボル記憶回路にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路の性能がIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できる性能を下回っていても算術符号化することができる。 Furthermore, according to the present invention, Even when arithmetic coding such as CABAC defined by H.264 is performed, rate control can be performed before the coding of all MBs included in a group of MBs that are vertically continuous is completed. For this reason, when the generated code amount of a certain MB suddenly increases, the quantization parameter of the MB to be encoded next is quickly increased, and the code amount generated from the newly encoded MB is decreased. Rate control is possible. In addition, arithmetic coding can be performed even if the arithmetic coding circuit does not have enough performance to handle the amount of binarized symbols that suddenly increases. In particular, if the binarized symbol storage circuit has sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the performance of the arithmetic coding circuit can be improved. Arithmetic coding can be performed even if the performance of the binarized symbol generation amount that suddenly occurs in the I picture is less than the capability of processing .

また、本発明によれば、シーンチェンジ等があった場合でも真の算術符号化による発生符号量に基づくレート制御に近いレート制御を行うことができる。 Further, according to the present invention, even when there is a scene change or the like, it is possible to perform rate control close to rate control based on the generated code amount by true arithmetic coding .

更に、本発明によれば、あるMBの2値化シンボルの発生量が突発的に増加し、仮算術符号化した結果真の算術符号化回路の処理能力を超えると予測されるときにはそのMBを含むピクチャ全体をCAVLC符号化し、一方、仮算術符号化した結果真の算術符号化回路で処理できると予測されるときにはそのMBを含むピクチャ全体をCABAC符号化することができる。これにより、真の算術符号化回路の性能が不測するという状況を確実に回避できる。更に、CAVLC符号化回路でCAVLC符号化ビットストリームの符号量を算出し、CAVLC符号化と仮算術符号化の仮発生符号量を比較して、ピクチャごとに発生符号量が少ないと推測されるエントロピー符号化モードを選択することもできる。 Furthermore, according to the present invention, when the amount of binarized symbols generated in a certain MB suddenly increases and is predicted to exceed the processing capacity of a true arithmetic encoding circuit as a result of provisional arithmetic encoding, The entire picture including the MB can be CABAC-encoded if it is predicted that the entire picture including the CAVLC code is encoded by the provisional arithmetic encoding and can be processed by a true arithmetic encoding circuit. As a result, a situation in which the performance of the true arithmetic coding circuit is unexpected can be surely avoided . Furthermore, the CAVLC encoding circuit calculates the code amount of the CAVLC encoded bitstream, compares the temporarily generated code amount of CAVLC encoding and provisional arithmetic encoding, and entropy that is estimated to be small for each picture. An encoding mode can also be selected.

本発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。   In the present invention, a plurality of MB rows that are vertically continuous are grouped, one MB is selected per MB row from the group of MB rows, and the selected plurality of MBs are one MB. Put continuously into the pipeline.

以下、本発明の実施の形態に係る動画像符号化装置および動画像符号化方法を図面に基づいて説明する。 Hereinafter, a moving picture coding apparatus and a moving picture coding method according to an embodiment of the present invention will be described with reference to the drawings.

(第1の実施形態)
図1はMBパイプラインに連続して投入されるMBの例を示した説明図である。図1のピクチャはa行からl行までの12のMB行からなり、各MB行は0番目から15番目までの16個のMBで構成される。図1のピクチャでは、最初にa−MB行、b−MB行、c−MB行、d−MB行に含まれるMBが1個のMBパイプラインで符号化され、次にe−MB行、f−MB行、g−MB行、h−MB行に含まれるMBが1個のMBパイプラインで符号化され、最後にi−MB行、j−MB行、k−MB行、l−MB行に含まれるMBが1個のMBパイプラインで符号化される。図1中のe行10列、f行8列、g行6列、h行4列のMBは1個のMBパイプラインに連続して投入されるMBの一例である。f行8列のMBはe行10列のMBから左方向にMB離れている。同様にg行6列のMBはf行8列のMBから左方向にMB離れており、h行4列のMBはg行6列のMBから左方向にMB離れている。これらの4つのMBは相互に左隣接、上隣接、または右上隣接のいずれの隣接関係にもない。以下では、複数のブロックが相互に左隣接、上隣接、または右上隣接のいずれの隣接関係にもないことを、これらのブロックは隣接関係にないという。
(First embodiment)
FIG. 1 is an explanatory diagram showing an example of MBs that are continuously input to the MB pipeline. The picture in FIG. 1 is composed of 12 MB rows from a row to l row, and each MB row is composed of 16 MBs from 0th to 15th. In the picture of FIG. 1, first, MBs included in the a-MB row, b-MB row, c-MB row, and d-MB row are encoded by one MB pipeline, and then the e-MB row, MBs included in the f-MB line, the g-MB line, and the h-MB line are encoded by one MB pipeline, and finally the i-MB line, the j-MB line, the k-MB line, and the l-MB. MB included in a row is encoded by one MB pipeline. The MB of e row 10 column, f row 8 column, g row 6 column, and h row 4 column in FIG. 1 is an example of an MB that is continuously input to one MB pipeline. The MB in f row and 8 columns is 1 MB away from the MB in e row and 10 columns in the left direction. Similarly MB of g line 6 columns are spaced 1 MB to the left from the MB of f line 8 column, MB of h rows and four columns are spaced 1 MB to the left from the MB of g line 6 column. These four MBs are not adjacent to each other in the left adjacent, the upper adjacent, or the upper right adjacent. In the following, it is said that these blocks are not adjacent to each other, that the plurality of blocks are not adjacent to each other in the left adjacent, the upper adjacent, or the upper right adjacent.

図2は本発明が適用される動画像符号化装置のブロック図を示す。MB選択回路2は、図1に示すように、e−MB行、f−MB行、g−MB行、h−MB行をひとまとまりとし、e−MB行に属するMBについては、左下隣接MBがまだ選択されていないMBを選択し、かつ、f−MB行、g−MB行、およびh−MB行に属するMBについては、右上隣接MBが既に選択されているMBを選択することによって、e行10列、f行8列、g行6列、h行4列のMBを選択する。符号化データ設定回路3は、e行10列、f行8列、g行6列、h行4列のMBの順番で、各MBを符号化するために必要なデータをMBパイプライン1に設定する。MBを符号化するために必要なデータがMBパイプライン1に設定されると、そのMBはMBパイプライン1に投入される。h行4列のMBを符号化するために必要なデータがMBパイプライン1に設定され、h行4列のMBがMBパイプライン1に投入されると、MB選択回路2は、e行11列、f行9列、g行7列、h行5列のMBを新たに選択する。   FIG. 2 shows a block diagram of a moving picture coding apparatus to which the present invention is applied. As shown in FIG. 1, the MB selection circuit 2 collects the e-MB row, the f-MB row, the g-MB row, and the h-MB row, and the MBs belonging to the e-MB row By selecting an MB that has not yet been selected and, for MBs belonging to f-MB, g-MB, and h-MB rows, by selecting an MB for which the upper right neighboring MB has already been selected, The MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column is selected. The encoded data setting circuit 3 sends data necessary for encoding each MB to the MB pipeline 1 in the order of MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column. Set. When data necessary for encoding an MB is set in the MB pipeline 1, the MB is input to the MB pipeline 1. When the data necessary for encoding the MB of h rows and 4 columns is set in the MB pipeline 1 and the MB of h rows and 4 columns is input to the MB pipeline 1, the MB selection circuit 2 A new MB of column, f row 9 column, g row 7 column, h row 5 column is selected.

図3は本発明が適用される動画像符号化方法の処理のフローチャートを示す。e−MB行、f−MB行、g−MB行、h−MB行をひとまとまりとし、e−MB行に属するMBについては、左下隣接MBがまだ選択されていないMBを選択し、かつ、f−MB行、g−MB行、およびh−MB行に属するMBについては、右上隣接MBが既に選択されているMBを選択することによって、e行10列、f行8列、g行6列、h行4列のMBを選択する(ステップS1)。次に、e行10列、f行8列、g行6列、h行4列のMBの順番で、各MBを符号化するために必要なデータをMBパイプライン1に設定し、順次MBパイプラインに投入する(ステップS2、ステップS3)。MBを符号化するために必要なデータがMBパイプライン1に設定されると、そのMBはMBパイプライン1に投入される。h行4列のMBを符号化するために必要なデータがMBパイプライン1に設定され、h行4列のMBがMBパイプライン1に投入されると、ステップS1に戻り(ステップS4)、e行11列、f行9列、g行7列、h行5列のMBを新たに選択する(ステップS1)。   FIG. 3 shows a flowchart of the process of the moving picture encoding method to which the present invention is applied. e-MB line, f-MB line, g-MB line, and h-MB line are grouped, and for MBs belonging to the e-MB line, an MB for which the lower left neighboring MB is not yet selected is selected; and For MBs belonging to the f-MB row, the g-MB row, and the h-MB row, by selecting the MB for which the upper right adjacent MB has already been selected, the e row 10 column, the f row 8 column, the g row 6 An MB with 4 columns and h rows is selected (step S1). Next, data necessary for encoding each MB is set in the MB pipeline 1 in the order of MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column, Input into the pipeline (steps S2 and S3). When data necessary for encoding an MB is set in the MB pipeline 1, the MB is input to the MB pipeline 1. When the data necessary for encoding the MB of h rows and 4 columns is set in the MB pipeline 1 and the MB of h rows and 4 columns is input to the MB pipeline 1, the process returns to step S1 (step S4). MBs of e row 11 column, f row 9 column, g row 7 column, h row 5 column are newly selected (step S1).

これら4個のMBを1個のMBパイプライン1に連続して投入したときに、各MBがMBパイプライン1の各ステージを流れていく様子を図4に示す。ステージ0からステージ6の各処理内容は図45のものと同じである。また、図1のピクチャを構成する各MBがMBパイプライン1に投入され、ステージ0の処理が開始されるMBサイクル番号を図5に示す。図4に示すように、e行10列、f行8列、g行6列、h行4列の4個のMBは、MBサイクル番号がそれぞれ104、105、106、107のとき順番にステージ0に投入され、MBサイクル番号がそれぞれ110、111、112、113のとき順番にステージ6に達して符号化が終了する。このように、ひとまとまりの4つのMB行の中で、最も上のMB行に属するMB、上から2番目のMB行に属するMB、上から3番目のMB行に属するMB、上から4番目のMB行に属するMBの順番にMBパイプライン1に投入され、続いてそれらの右隣接MBが同様の順番でMBパイプライン1に投入される。   FIG. 4 shows a state in which each MB flows through each stage of the MB pipeline 1 when these four MBs are continuously input to one MB pipeline 1. The processing contents of stage 0 to stage 6 are the same as those in FIG. FIG. 5 shows MB cycle numbers at which the MBs constituting the picture of FIG. 1 are input to the MB pipeline 1 and the stage 0 process is started. As shown in FIG. 4, four MBs of e row 10 column, f row 8 column, g row 6 column, h row 4 column are staged in order when the MB cycle numbers are 104, 105, 106, and 107, respectively. When the MB cycle numbers are 110, 111, 112, and 113, respectively, the stage 6 is reached in order and the encoding is completed. Thus, among a group of four MB rows, the MB belonging to the uppermost MB row, the MB belonging to the second MB row from the top, the MB belonging to the third MB row from the top, the fourth from the top The MBs that belong to the MB row are input to the MB pipeline 1 in the order of MBs, and then the right adjacent MBs are input to the MB pipeline 1 in the same order.

本発明によれば、本実施形態のようにひとまとまりとして符号化するMB行の数が4のとき、左隣接MBの処理結果を3ステージ分フィードバックし、現MBの処理に反映できる。このため、図4中に矢印で示すように、例えば、f行7列のMBの高精度の動き検出結果とイントラ予測結果をf行8列のMBの粗い精度の動き検出に反映できる。このように、従来の技術と異なり、左に隣接したMBの高精度の動き検出結果とイントラ予測結果を考慮して現MBの動きベクトルを選択することができる。また、同様に矢印で示すように、f行7列のMBの動き補償の結果をf行8列のMBのイントラ予測に反映できる。従って、従来の技術と異なり、左に隣接したMBの動き補償により求められた再生画素を用いて現MBのイントラ予測を行うことができる。更に、f行7列のMBのレート制御結果をf行8列のMBの量子化に反映できる。このように、左に隣接したMBのレート制御結果に応じて現MBの量子化パラメータを修正することができる。 According to the present invention, as human unity as in the present embodiment when the number of MB rows to be encoded is 4, and three-stage partial feedback of the processing result of the left neighboring MB, it can be reflected in the processing of the current MB. Therefore, as indicated by an arrow in FIG. 4, for example, the high-precision motion detection result and the intra prediction result of the f-row 7-column MB can be reflected in the coarse-precision motion detection of the f-row 8-column MB. Thus, unlike the conventional technique, the motion vector of the current MB can be selected in consideration of the high-precision motion detection result and intra prediction result of the MB adjacent to the left. Similarly, as indicated by an arrow, the result of motion compensation of the MB of f rows and 7 columns can be reflected in the intra prediction of MBs of f rows and 8 columns. Therefore, unlike the conventional technique, intra prediction of the current MB can be performed using the reproduced pixels obtained by the motion compensation of the MB adjacent to the left. Further, the rate control result of the MB of f rows and 7 columns can be reflected in the quantization of MBs of f rows and 8 columns. In this manner, the quantization parameter of the current MB can be corrected according to the rate control result of the MB adjacent to the left.

ここで、本実施形態では下に隣接したMB行に含まれるMBが上のMB行中のMBから左方向にMB離れている場合を示したが、MB以上離れていれば良く、例えばMB離れていても本発明の目的を達成することができ、同様の作用・効果を生じる。また、縦に連続する4つのMB行をひとまとまりとして、これら4つのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された4個のMBを1個のMBパイプラインに連続して投入する例を示したが、ひとまとまりのMB行の数は2以上であれば良く、例えば縦に連続する8つのMB行をひとまとまりとして、これら8つのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された8個のMBを1個のMBパイプラインに連続して投入しても本発明の目的を達成することができ、同様の作用・効果を生じる。ただし、ひとまとまりのMB行の数が2のときは、左隣接MBの処理結果を1ステージ分しか現MBの処理にフィードバックできないため、図4のステージ構成では左隣接MBの動き補償とレート制御の結果をそれぞれ現MBのイントラ予測と整数変換・量子化・逆量子化・逆整数変換にフィードバックできない。ひとまとまりのMB行の数が2のときは、図4に示したものとステージ構成を変更する必要がある。 Here, MB included in the MB row adjacent to the bottom in the present embodiment showed a case in which distant 1 MB to the left from the MB in MB line above, it is sufficient that apart at least 1 MB, for example, The object of the present invention can be achieved even at a distance of 2 MB, and the same actions and effects are produced. Also, taking four MB rows that are vertically continuous as a group, one MB per MB row is selected from these four MB rows, and these four MBs are selected as one MB pipeline. However, it is sufficient that the number of MB lines in a group is two or more. For example, eight MB lines that are vertically continuous are grouped, and one of these eight MB lines is used as one group. Even if one MB is selected per MB row, and the selected 8 MBs are continuously input to one MB pipeline, the object of the present invention can be achieved, and similar operations and effects are achieved. Produce. However, when the number of MB rows in a group is 2, the processing result of the left adjacent MB can be fed back to the current MB processing for only one stage. Therefore, in the stage configuration of FIG. Cannot be fed back to the current MB intra prediction and integer transform / quantization / inverse quantization / inverse integer transform. When the number of MB lines in a group is 2, it is necessary to change the stage configuration from that shown in FIG.

(第2の実施形態)
図6は8画素×8画素の4つのSB(以下、8×8SBという。)に分割されたMBを示す。本実施形態では、4つの8×8SBについて動きベクトルのコストと予測誤差のコストの和が最小となる動きベクトルを検出する例について示す。一般に、PMVと動きベクトルの距離が遠いほど動きベクトルのコストは高いと評価される。このため、各8×8SBについて動き検出を始める前に、その8×8SBのPMVが決まっていなければならない。そして、例えば、左隣接8×8SB、上隣接8×8SB、右上隣接8×8SBの動きベクトルに基づいてPMVを決めるとすると、図6中の0、1、2、3の番号を付された順番に8×8SBごとの動きベクトルを検出しなければならないことになる。ただし、3番の8×8SBの動きベクトル検出時に右上隣接8×8SBの動きベクトルは存在しないため、3番の8×8SBのPMVは1番と2番の8×8SBの動きベクトルMV1とMV2に基づいて決められる。
(Second Embodiment)
FIG. 6 shows an MB divided into four SBs of 8 pixels × 8 pixels (hereinafter referred to as 8 × 8SB). In the present embodiment , an example will be described in which a motion vector that minimizes the sum of the cost of a motion vector and the cost of a prediction error is detected for four 8 × 8 SBs. Generally, it is estimated that the cost of a motion vector is higher as the distance between the PMV and the motion vector is longer. For this reason, before starting motion detection for each 8 × 8 SB, the 8 × 8 SB PMV must be determined. For example, if PMV is determined based on the motion vector of the left adjacent 8 × 8SB, the upper adjacent 8 × 8SB, and the upper right adjacent 8 × 8SB, the numbers 0, 1, 2, and 3 in FIG. The motion vectors for every 8 × 8 SB must be detected in order. However, since the 8 × 8SB motion vector adjacent to the upper right side does not exist when the third 8 × 8SB motion vector is detected, the third 8 × 8SB PMV is the first and second 8 × 8SB motion vectors MV1 and MV2. It is decided based on.

図7はMBパイプラインに連続して投入されるMBの例を示した説明図である。図7のピクチャはa行から始まっており、r行の下方にもMB行が存在する。また、16列以降にもMBが存在する。本実施形態ではi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとして、これらひとまとまりのMB行から、i行15列、j行13列、k行11列、l行9列、m行7列、n行5列、o行3列、p行1列のMBを選択し、これら選択された8つのMBを1個のMBパイプラインに連続して投入する例を示す。 FIG. 7 is an explanatory diagram showing an example of MBs continuously input to the MB pipeline. The picture in FIG. 7 starts from the a line, and there is an MB line below the r line. There are also MBs after the 16th column. In the present embodiment , the i-MB line, j-MB line, k-MB line, l-MB line, m-MB line, n-MB line, o-MB line, and p-MB line are grouped together. Select MB of i row 15 column, j row 13 column, k row 11 column, l row 9 column, m row 7 column, n row 5 column, o row 3 column, p row 1 column from a group of MB rows. An example is shown in which these eight selected MBs are continuously input into one MB pipeline.

図8は8×8SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示す。図9は本発明が適用される動きベクトル検出回路12のブロック図を示す。外部メモリ4には単画素精度の画像が記憶されている。ステージ0で外部メモリ4から画像を読み出す。その画像を2画素精度画像作成回路5で縮小して2画素精度の画像を作成し、2画素精度メモリ6に書き込む。ステージ1で2画素精度メモリから画像を読み出しながら、2画素精度動き検出回路7により2画素精度の候補動きベクトルを検出する。そして、ステージ2で候補ベクトルの周辺の領域を外部メモリ4から読み出して、単画素精度メモリ8に書き込む。ここで、一般に外部の大容量メモリは低速であるため、外部メモリ4から単画素精度メモリ8に転送するために1ステージ割り当てている。単画素精度メモリ8から2画素精度候補ベクトルの周辺の領域を読み出しながら、ステージ3で単画素精度動き検出回路9により動きベクトルを検出する。その後、ステージ4で単画素精度メモリ8から単画素精度画素を読み出して、1/4画素精度画像作成回路10で1/4画素精度の画像を作成しながら1/4画素精度動きベクトル検出回路11を用いて1/4画素精度動きベクトル検出を行う。単画素精度メモリ8からは単画素精度動き検出回路9と1/4画素精度画像作成回路10に単画素精度画像を供給することになるため、単画素精度メモリ8はダブルバッファ構成や2リード以上可能な多ポートメモリとする必要がある。なお、図8ではステージ4で単画素精度動きベクトルの周囲を直接探索して1/4画素精度動きベクトルを検出するとしたが、ステージ4で半画素精度動きベクトルを検出した後、ステージ5で半画素精度動きベクトルの周囲を探索して1/4画素精度動きベクトルを検出しても良い。また、ステージ3で単画素精度動きベクトル検出と半画素精度動きベクトル検出を行い、ステージ4で1/4画素精度動きベクトル検出を行っても良い。 FIG. 8 shows how each MB flows through each stage when MBs included in 8 MB rows are continuously input to one MB pipeline in order to detect a motion vector every 8 × 8 SB. Show. FIG. 9 shows a block diagram of a motion vector detection circuit 12 to which the present invention is applied. The external memory 4 stores an image with single pixel accuracy. At stage 0, an image is read from the external memory 4. The image is reduced by the two-pixel precision image creation circuit 5 to create a two-pixel precision image and written in the two-pixel precision memory 6. While reading an image from the two-pixel accuracy memory 6 at the stage 1, a two-pixel accuracy motion detection circuit 7 detects a candidate motion vector with two-pixel accuracy. Then, in stage 2, the area around the candidate vector is read from the external memory 4 and written to the single pixel precision memory 8. Here, since the external large-capacity memory is generally low speed, one stage is allocated for transfer from the external memory 4 to the single pixel precision memory 8. While reading the area around the two-pixel accuracy candidate vector from the single-pixel accuracy memory 8, the motion vector is detected by the single-pixel accuracy motion detection circuit 9 in the stage 3. Thereafter, the single pixel precision pixel is read from the single pixel precision memory 8 at the stage 4, and the quarter pixel precision motion vector detection circuit 11 is created while creating the quarter pixel precision image by the quarter pixel precision image creation circuit 10. Is used to perform 1/4 pixel precision motion vector detection. Since the single pixel accuracy memory 8 supplies a single pixel accuracy image to the single pixel accuracy motion detection circuit 9 and the ¼ pixel accuracy image creation circuit 10, the single pixel accuracy memory 8 has a double buffer configuration or more than two reads. It must be possible multi-port memory. In FIG. 8, the surrounding of the single-pixel accuracy motion vector is directly searched at stage 4 to detect the 1 / 4-pixel accuracy motion vector. However, after detecting the half-pixel accuracy motion vector at stage 4, A ¼ pixel accuracy motion vector may be detected by searching around the pixel accuracy motion vector. Further, single-pixel precision motion vector detection and half-pixel precision motion vector detection may be performed in stage 3, and quarter-pixel precision motion vector detection may be performed in stage 4.

ステージ1〜ステージ5ではMBサイクルを4つのSBサイクルに分割し、各SBサイクルで8×8SBごとの処理を行う。ここで、SBサイクルとは、1個のSBが処理されるために要する時間の単位をいい、SBごとの処理を行うとき、MBサイクルはSBサイクルに分割される。以下では、MBサイクルがSBサイクルに分割され、SBごとの処理を行うステージ群をSBパイプライン(またはサブブロックパイプライン)と呼ぶ。図8中のステージ1〜ステージ5がSBパイプラインである。図10はSBパイプラインの詳細な動作を示す。−0、−1、−2、−3はそれぞれ図6中の0、1、2、3の番号を付された8×8SBを意味する。例えば、i15−2はi行15列のMBに含まれる2番目の8×8SBを表す。図10では、ステージ5に空ステージを挿入し、例えばi15−0SBについてステージ4で検出された1/4画素精度動きベクトルをi15−1SBのステージ1における2画素精度動きベクトルのコスト計算に反映できるようにしている。このように、MBサイクルをSB数に等しい数のSBサイクルに分割したときは、(SB数+1)段のパイプラインとすることにより、同一のMB内における前の8×8SBの処理結果を次の8×8SBに反映させることができる。   In stages 1 to 5, the MB cycle is divided into four SB cycles, and each 8 × 8 SB process is performed in each SB cycle. Here, the SB cycle means a unit of time required for processing one SB, and when performing processing for each SB, the MB cycle is divided into SB cycles. Hereinafter, the stage group in which the MB cycle is divided into SB cycles and processing for each SB is performed is referred to as an SB pipeline (or sub-block pipeline). Stages 1 to 5 in FIG. 8 are SB pipelines. FIG. 10 shows the detailed operation of the SB pipeline. −0, −1, −2 and −3 mean 8 × 8SB numbered 0, 1, 2, 3 in FIG. For example, i15-2 represents the second 8 × 8SB included in the MB of i rows and 15 columns. In FIG. 10, an empty stage is inserted into the stage 5, and for example, a ¼ pixel precision motion vector detected in the stage 4 for i15-0SB can be reflected in the cost calculation of the 2-pixel precision motion vector in the stage 1 of i15-1SB. I am doing so. As described above, when the MB cycle is divided into the number of SB cycles equal to the number of SBs, the processing result of the previous 8 × 8 SB in the same MB is obtained by setting a pipeline of (SB number + 1) stages. Of 8 × 8SB.

なお、ステージ1〜ステージ5において8×8SBごとの動きベクトル検出回路と並列に動作するMBごとの動きベクトル検出回路を設けることが可能である。また、ステージ3〜5において、ステージ1において検出された8×8SBごとの候補ベクトルの周辺領域で8×8SBごとの動きベクトル検出と並列にMBごと、16画素×8画素SBごと、8画素×16画素SBごとの動きベクトルを検出することも可能である。   In stage 1 to stage 5, it is possible to provide a motion vector detection circuit for each MB that operates in parallel with a motion vector detection circuit for each 8 × 8 SB. Further, in stages 3 to 5, in the peripheral region of the candidate vectors for each 8 × 8SB detected in stage 1, motion vector detection for each 8 × 8SB is performed in parallel with the motion vector detection for each 8 × 8SB, for each 16 pixels × 8 pixels SB, for 8 pixels × It is also possible to detect a motion vector for every 16 pixels SB.

ステージ0〜5において動きベクトルが検出された後は、ステージ6で16×16イントラ予測モード、4×4イントラ予測モード、インター予測モード等の中から符号化効率の最も良くなる予測モードが選択される。ステージ7では整数変換、量子化、逆量子化、および逆整数変換が行われる。ステージ8では可変長符号化と動き補償が行われる。ステージ9ではレート制御とデブロッキングフィルタ処理が行われ、ステージ10では再生画素や符号化ビットストリームが外部メモリ4に書き込まれる。   After motion vectors are detected in stages 0 to 5, a prediction mode with the highest coding efficiency is selected from 16 × 16 intra prediction mode, 4 × 4 intra prediction mode, inter prediction mode, and the like in stage 6. The In stage 7, integer transformation, quantization, inverse quantization, and inverse integer transformation are performed. In stage 8, variable length coding and motion compensation are performed. In stage 9, rate control and deblocking filter processing are performed. In stage 10, the reproduced pixels and the encoded bit stream are written in the external memory 4.

(第3の実施形態)
本実施形態では、1/4画素精度動き検出回路11を2個設け、ステージ3とステージ4を結合して、1個の8×8SBの1/4画素精度動き検出を2SBサイクルかけて行う例を示す。ステージ3とステージ4以外は、第2の実施形態のMBパイプラインと同一のステージ構成である。図11はSBパイプラインの詳細な動作を示し、図12はこの動作を実現するための動き検出回路13のブロック図を示す。2つの1/4画素精度動き検出回路11を1SBサイクルずらして動作させることにより、個々の8×8SBの1/4画素精度動き検出を2SBサイクルかけて行うことができる。
(Third embodiment)
In this embodiment, 1/4-pixel accuracy motion detection circuit 11 is provided two combines the stage 3 and stage 4 is performed by the quarter-pixel precision motion detection of a single 8 × 8SB over 2SB Cycle Example Indicates. Except for stage 3 and stage 4, the stage configuration is the same as that of the MB pipeline of the second embodiment . FIG. 11 shows the detailed operation of the SB pipeline, and FIG. 12 shows a block diagram of the motion detection circuit 13 for realizing this operation. By operating the two quarter-pixel precision motion detection circuits 11 with a shift of 1 SB cycle, individual 8 × 8 SB quarter-pixel precision motion detection can be performed over 2 SB cycles.

(第4の実施形態)
本実施形態では、H.264における4画素×4画素イントラ予測(以下、4×4イントラ予測という。)に本発明を適用する例ついて説明する。図13は16個の4画素×4画素SB(以下、4×4SBという。)に分割されたMBを示す。4×4SBは図13中に付した0〜15の順番で符号化され、ビットストリームに変換される。例えば、3番の4×4SBについて4×4イントラ予測を行うときには、1番の4×4SBにおける下端4行の画素と2番の4×4SBの右端4列の画素が参照される。また、14番の4×4SBについて4×4イントラ予測を行うときには、12番と13番の4×4SBにおける下端の4行の画素と11番の4×4SBにおける右端4列の画素が参照される。これら隣接4×4SBに属する画素は再生画素を用いることが望ましい。
(Fourth embodiment)
In this embodiment, H. An example in which the present invention is applied to 4 pixel × 4 pixel intra prediction (hereinafter referred to as 4 × 4 intra prediction) in H.264 will be described. FIG. 13 shows an MB divided into 16 4 pixels × 4 pixels SB (hereinafter referred to as 4 × 4 SB). 4 × 4SB is encoded in the order of 0 to 15 in FIG. 13 and converted into a bit stream. For example, when 4 × 4 intra prediction is performed for the third 4 × 4SB, the pixels in the lowermost 4 rows of the first 4 × 4SB and the pixels in the fourth rightmost 4 columns of the second 4 × 4SB are referred to. In addition, when performing 4 × 4 intra prediction for the 14th 4 × 4SB, the pixels at the bottom four rows in the 12th and thirteenth 4 × 4SB and the pixels at the rightmost four columns in the 11th 4 × 4SB are referred to. The As the pixels belonging to these adjacent 4 × 4 SBs, it is desirable to use reproduction pixels.

図14は、4×4イントラ予測のために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示す。ステージ4で隣接4×4SBの再生画素を用いて4×4イントラ予測を行い、ステージ5で予測誤差に対して整数変換・量子化・逆整数変換・逆量子化を行ってイントラ予測値を加算し、再生画素を生成する。ステージ4の4×4イントラ予測回路とステージ5の整数変換・量子化・逆整数変換・逆量子化回路は、第2の実施形態または第3の実施形態で示したステージ1〜ステージ5の動き検出回路と並列に動作する。 FIG. 14 shows a state where each MB flows through each stage when MBs included in eight MB rows are continuously input to one MB pipeline for 4 × 4 intra prediction. Stage 4 performs 4 × 4 intra prediction using adjacent 4 × 4 SB reconstructed pixels, and stage 5 performs integer transformation, quantization, inverse integer transformation, and inverse quantization on the prediction error, and adds the intra prediction value Then, a reproduction pixel is generated. The 4 × 4 intra prediction circuit of stage 4 and the integer transform / quantization / inverse integer transform / inverse quantization circuit of stage 5 are the movements of stage 1 to stage 5 shown in the second embodiment or the third embodiment. Operates in parallel with the detection circuit.

本実施形態では、ステージ4と5においてMBサイクルを16のSBサイクルに分割する。このため、SBパイプラインのステージ数に比べてSBの数が多く、(SB数+1)段のSBパイプラインとすると、空ステージが増加し、効率が悪い。図15はSBパイプラインの詳細な動作を示す。−0、−1、−2、……、−15はそれぞれ図13中の0、1、2、……、15の番号を付された4×4SBを意味する。例えば、i15−8はi行15列のMBに含まれる8番目の4×4SBを表す。図15に示すように、本実施形態では、2つのMBに含まれる4×4SBを交互に処理することにより、1つのMBを2MBサイクル、すなわち32SBサイクルかけて処理する。1つのMBに属する4×4SBを4×4イントラ予測しているとき、同時に別のMBに属する4×4SBを整数変換・量子化・逆整数変換・逆量子化する。MBサイクルごとに1つのMBの処理を開始し、別のMBの処理を終えるように動作させ、MBパイプラインの他ステージと整合を取る。ただし、このように動作させると、図15に示すように、ステージ4の4×4イントラ予測において、2MBサイクルごとに1SBサイクル、すなわち1/16MBサイクルだけMBサイクルとずれが発生する。そのため、図15では、ステージ3の有効期間を15/16MBサイクルとし、ステージ4における1/16MBサイクルのずれを吸収している。なお、ステージ3の処理が重く、無効期間を設けることができないときは、ステージ6の有効期間を15/16MBサイクルとし、1/16MBサイクルのずれを吸収しても良い。このように動作させることにより、4×4イントラ予測回路と整数変換・量子化・逆整数変換・逆量子化を行う回路に空を生じることなく、左隣接、上隣接、右上隣接の4×4SBに属する画素について再生画素を用いて4×4イントラ予測を行うことができる。 In the present embodiment divides the MB cycle 16 of SB cycle at stage 4 and 5. For this reason, if the number of SBs is larger than the number of stages in the SB pipeline, and the number of SB pipelines is (SB number + 1), the number of empty stages increases and the efficiency is poor. FIG. 15 shows the detailed operation of the SB pipeline. −0, −1, −2,..., -15 means 4 × 4SB numbered 0, 1, 2,. For example, i15-8 represents the 8th 4 × 4SB included in the MB of i rows and 15 columns. As shown in FIG. 15, in this embodiment , by processing 4 × 4 SB included in two MBs alternately, one MB is processed over 2 MB cycles, that is, 32 SB cycles. When 4 × 4 SB belonging to one MB is subjected to 4 × 4 intra prediction, 4 × 4 SB belonging to another MB is simultaneously subjected to integer transformation / quantization / inverse integer transformation / inverse quantization. The processing of one MB is started every MB cycle, and the processing of another MB is finished, and matching with the other stages of the MB pipeline is performed. However, when operated in this way, as shown in FIG. 15, in the 4 × 4 intra prediction of stage 4, a deviation from the MB cycle occurs by 1 SB cycle, that is, 1/16 MB cycle every 2 MB cycles. Therefore, in FIG. 15, the effective period of stage 3 is set to 15/16 MB cycle, and the shift of 1/16 MB cycle in stage 4 is absorbed. If the stage 3 process is heavy and an invalid period cannot be provided, the stage 6 valid period may be set to 15/16 MB cycle to absorb the 1/16 MB cycle shift. By operating in this way, 4 × 4 SBs of the left adjacent, upper adjacent, and upper right adjacent can be generated without causing a sky in the 4 × 4 intra prediction circuit and the circuits that perform integer transform / quantization / inverse integer transform / inverse quantization. 4 × 4 intra prediction can be performed using the reconstructed pixels for the pixels belonging to.

なお、SBパイプラインの前または後のステージの有効期間を短縮するのではなく、SBパイプラインの前または後に空ステージを挿入することによって、MBパイプラインのずれを吸収することもできる。   It should be noted that the MB pipeline shift can be absorbed by inserting an empty stage before or after the SB pipeline, instead of shortening the effective period of the stage before or after the SB pipeline.

本実施形態では、図14に矢印で示すように、左隣接MBのレート制御結果を4×4イントラ予測に付随して行う量子化に反映することができる。 In this embodiment, as shown by the arrows in FIG. 14, it can be reflected to the quantization performed concomitantly rate control results in the left neighboring MB to 4 × 4 intra prediction.

また、輝度信号の16画素×16画素イントラ予測や4:2:0フォーマットのときの色差信号の8画素×8画素イントラ予測はMBごとに処理される。このため、左隣接MBと上隣接MBに属する画素を参照できれば良い。この場合、ステージ8の動き補償で得られる再生画素を参照できるため、4×4イントラ予測のようにステージ5で整数変換・量子化・逆整数変換・逆量子化を行う必要はない。なお、ステージ6のイントラ・インター判定で4×4イントラ予測モードが選択された場合には、ステージ5の整数変換・量子化・逆整数変換・逆量子化で得られた再生画素を保存しておく構成としても、ステージ7で再度整数変換・量子化・逆整数変換・逆量子化を行う構成としても良い。   Further, 16 pixel × 16 pixel intra prediction of the luminance signal and 8 pixel × 8 pixel intra prediction of the color difference signal in the 4: 2: 0 format are processed for each MB. For this reason, it is only necessary to refer to pixels belonging to the left adjacent MB and the upper adjacent MB. In this case, since the reconstructed pixel obtained by the motion compensation in stage 8 can be referred to, there is no need to perform integer transformation / quantization / inverse integer transformation / inverse quantization in stage 5 as in 4 × 4 intra prediction. When the 4 × 4 intra prediction mode is selected in the intra / inter determination in stage 6, the reproduced pixels obtained by the integer transform, quantization, inverse integer transform, and inverse quantization in stage 5 are stored. Alternatively, the stage 7 may be configured to perform integer transformation / quantization / inverse integer transformation / inverse quantization again in the stage 7.

なお、4×4イントラ予測のモード判定を入力された画素によって行うことにすれば、ステージ5の整数変換・量子化・逆整数変換・逆量子化は省略することができる。ただし、再生画素を用いてモード判定した場合に比べ、画質は劣化する。   If the mode determination of 4 × 4 intra prediction is performed by the input pixels, the integer transformation / quantization / inverse integer transformation / inverse quantization in stage 5 can be omitted. However, the image quality is deteriorated as compared with the case where the mode is determined using the reproduction pixels.

(第5の実施形態)
本実施形態では、第2の実施形態〜第4の実施形態とほぼ同一のステージ構成のMBパイプラインにおいて、図7におけるi−MB行、j−MB行、k−MB行、l−MB行をひとまとまりとして、これらひとまとまりのMB行から、i行15列、j行13列、k行11列、l行9列等のMBを選択し、これら選択された4個のMBを1個のMBパイプラインに連続して投入する例を示す。第2の実施形態〜第4の実施形態では8つのMB行をひとまとまりとして処理するため、各左隣接MBの処理結果を7ステージ分現MBの処理にフィードバックできるが、本実施形態では3ステージ分しかフィードバックできない。このため、左隣接MBの処理結果を現MBの処理に反映するとき、第2の実施形態〜第4の実施形態に比べて制限が生じる。
(Fifth embodiment)
In the present embodiment , in the MB pipeline having substantially the same stage configuration as the second to fourth embodiments , the i-MB row, j-MB row, k-MB row, and l-MB row in FIG. Are selected, and MBs such as i rows 15 columns, j rows 13 columns, k rows 11 columns, l rows 9 columns, etc. are selected from these MB rows, and one of these four selected MBs is selected. An example of continuously charging to the MB pipeline is shown. In the second to fourth embodiments , since 8 MB rows are processed as a group, the processing result of each left adjacent MB can be fed back to the processing of 7 stages of MB. In this embodiment , 3 stages I can only give feedback. For this reason, when the processing result of the left adjacent MB is reflected in the processing of the current MB, there is a restriction compared to the second to fourth embodiments .

8×8SBごとの動きベクトルを検出するために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を図16に示す。この場合、例えば、ステージ5でj行12列のMBのイントラ・インター判定が終了したとき、同時にステージ1においてj行13列のMBの2画素精度動き検出も終了する。このため、左隣接MBのイントラ・インター判定結果を現MBの2画素精度動き検出に反映できないという制限がある。ただし、図16中に矢印で示すように、左隣接MBのイントラ・インター判定結果はステージ2以降に反映できる。また、左上隣接MB、上隣接MB、右上隣接MB、左方向に1つ離れたMB等についてステージ5で確定したイントラ・インター判定結果はステージ1の2画素精度動き検出に反映できる。そこで、ステージ1においては、左上隣接MB、上隣接MB、右上隣接MB、左方向に1つ離れたMB等の動きベクトルを参照して仮のPMVを作成し、4つの8×8SB全てが共通にこの仮のPMVを参照して2画素精度動き検出を行う。そして、ステージ2ではステージ1で検出された2画素精度の候補動きベクトルの周辺領域を単画素精度メモリ8に設定し、ステージ3で真のPMVを作成し、ステージ3とステージ4で真のPMVを参照して単画素精度動き検出と1/4画素精度動き検出を行う。   When MBs included in four MB rows are continuously input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB flows through each stage of the MB pipeline. Is shown in FIG. In this case, for example, when the intra / inter determination of the MB of j rows and 12 columns ends in stage 5, the 2-pixel precision motion detection of the MB of j rows and 13 columns ends simultaneously in stage 1. For this reason, there is a limitation that the intra / inter determination result of the left adjacent MB cannot be reflected in the two-pixel precision motion detection of the current MB. However, as indicated by arrows in FIG. 16, the intra / inter determination result of the left adjacent MB can be reflected in the stage 2 and subsequent stages. Also, the intra / inter determination result determined in stage 5 for the upper left adjacent MB, the upper adjacent MB, the upper right adjacent MB, the MB one left in the left direction, and the like can be reflected in the two-pixel accuracy motion detection in stage 1. Therefore, in stage 1, a temporary PMV is created with reference to motion vectors such as the upper left adjacent MB, the upper adjacent MB, the upper right adjacent MB, and the MB separated by one in the left direction, and all four 8 × 8 SBs are common. The two-pixel precision motion detection is performed with reference to the temporary PMV. In stage 2, the peripheral area of the candidate motion vector of 2-pixel accuracy detected in stage 1 is set in the single-pixel accuracy memory 8, a true PMV is created in stage 3, and a true PMV is created in stage 3 and stage 4. The single-pixel precision motion detection and the quarter-pixel precision motion detection are performed with reference to FIG.

図17はステージ3と4におけるSBパイプラインの詳細な動作を示す。ステージ3の単画素精度動き検出とステージ4の1/4画素精度動き検出では、2つのMBに含まれる8×8SBを交互に処理することにより、1つのMBを2MBサイクル、すなわち8SBサイクルかけて処理する。1個のMBに属する8×8SBについて単画素精度動き検出を行っているとき、同時に別のMBに属する8×8SBについて1/4画素精度動き検出を行う。MBサイクルごとに1個のMBの処理を開始し、別のMBの処理を終えるように動作させ、MBパイプラインの他ステージと整合を取る。そして、ステージ2の有効期間を3/4MBサイクルとし、ステージ4における1/4MBサイクルのずれを吸収する。この方法によれば、1つのMB内に含まれる4個の8×8SBについて0番から3番までシリアルに処理することができる。このため、単画素精度動き検出と1/4画素精度動き検出では隣接8×8SBの動きベクトルを考慮した真のPMVに基づいて動き検出を行うことができる。   FIG. 17 shows the detailed operation of the SB pipeline in stages 3 and 4. In single-pixel precision motion detection of stage 3 and quarter-pixel precision motion detection of stage 4, by processing 8 × 8SB included in two MBs alternately, one MB takes 2 MB cycles, that is, 8SB cycles. Process. When single pixel precision motion detection is performed for 8 × 8SB belonging to one MB, ¼ pixel precision motion detection is simultaneously performed for 8 × 8SB belonging to another MB. The processing of one MB is started for each MB cycle, and the processing is performed so as to finish the processing of another MB, so as to be consistent with the other stages of the MB pipeline. Then, the effective period of stage 2 is set to 3/4 MB cycle, and the shift of 1/4 MB cycle in stage 4 is absorbed. According to this method, four 8 × 8 SBs included in one MB can be serially processed from No. 0 to No. 3. For this reason, in the single-pixel precision motion detection and the quarter-pixel precision motion detection, it is possible to perform motion detection based on a true PMV in consideration of the adjacent 8 × 8 SB motion vector.

ただし、本実施形態では、空間ダイレクトアドレスの評価が別途必要となる。ステージ1で仮のPMVに基づいて2画素精度動き検出が行われ、ステージ2ではステージ1で検出された候補動きベクトルの周辺領域が単画素精度メモリ8に設定される。ステージ1の仮のPMVとステージ3の真のPMVが異なる場合、ステージ3と4で動き検出する領域に空間ダイレクトアドレスに対応する位置のMBや8×8SB等が含まれない。そこで、ステージ3およびステージ4と並列に空間ダイレクトアドレスに対応する位置のMBや8×8SBのコストを評価する処理を行う必要がある。 However, in the present embodiment, the evaluation of the spatial direct address required separately. In stage 1, two-pixel precision motion detection is performed based on the temporary PMV, and in stage 2, the peripheral area of the candidate motion vector detected in stage 1 is set in the single-pixel precision memory 8. When the temporary PMV of stage 1 and the true PMV of stage 3 are different, the motion detection areas in stages 3 and 4 do not include MB or 8 × 8 SB at the position corresponding to the spatial direct address. Therefore, it is necessary to perform processing for evaluating the MB of the position corresponding to the spatial direct address and the cost of 8 × 8 SB in parallel with stage 3 and stage 4.

4×4イントラ予測のために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を図18に示す。また、図19はステージ3と4におけるSBパイプラインの詳細な動作を示す。ステージ4の4×4イントラ予測とステージ5の整数変換・量子化・逆量子化・逆整数変換では、第4の実施形態のSBパイプラインと同様の処理を行う。 FIG. 18 shows how each MB flows through each stage of the MB pipeline when MBs included in four MB rows are continuously input to one MB pipeline for 4 × 4 intra prediction. Show. FIG. 19 shows the detailed operation of the SB pipeline in stages 3 and 4. In the 4 × 4 intra prediction in stage 4 and the integer transform / quantization / inverse quantization / inverse integer transform in stage 5, the same processing as in the SB pipeline of the fourth embodiment is performed.

ただし、本実施形態では左隣接MBの処理結果を3ステージ分しか現MBの処理にフィードバックできないため、動き補償をステージ7で行うと左隣接MBの再生画素を用いて4×4イントラ予測を行うことができない。そこで、動き補償をステージ6で行なわなければならないという制限がある。また、左隣接MBのステージ8のレート制御結果を反映できるのはステージ5以降であって、ステージ4の量子化には反映できない。しかし、ステージ7の可変長符号化によって大量のビットが発生し、ステージ8で量子化パラメータを大きくするというレート制御を行う必要が生じる場合がある。この場合には、ステージ5のイントラ・インター判定において4×4イントラ予測モードを選択しないようにするか、または4×4イントラ予測モードが選択されたときはステージ6で新しい量子化パラメータを用いて整数変換・量子化・逆量子化・逆整数変換をやり直す必要がある。 However, in this embodiment , since the processing result of the left adjacent MB can be fed back to the current MB processing only for the three stages, if motion compensation is performed at stage 7, 4 × 4 intra prediction is performed using the reproduced pixels of the left adjacent MB. I can't. Therefore, there is a limitation that motion compensation must be performed at stage 6. The rate control result of stage 8 of the left adjacent MB can be reflected after stage 5 and cannot be reflected in the quantization of stage 4. However, there are cases where a large amount of bits are generated by variable length coding in stage 7 and it is necessary to perform rate control to increase the quantization parameter in stage 8. In this case, the 4 × 4 intra prediction mode is not selected in the intra / inter determination of stage 5, or the new quantization parameter is used in stage 6 when the 4 × 4 intra prediction mode is selected. It is necessary to redo integer conversion, quantization, inverse quantization, and inverse integer conversion.

上記第1の実施形態〜第5の実施形態で示したように、本発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。これらのMBは狭い画像領域にあるため、下に隣接したMB行に属するMBの符号化が終了するまで、そのMBの上隣接MBと右上隣接MBの再生画素や動きベクトル等を画像符号化装置内に保持することにしてもその保持に要する記憶回路の規模は小さい。この記憶回路を設けることにより、これら複数のMB行の一番上のMB行に含まれるMBを除いて、現MBの符号化のために上隣接MBと右上隣接MBの再生画素や動きベクトル等を供給するという問題を解消することができる。 As shown in the first to fifth embodiments , in the present invention, a plurality of MB rows that are vertically continuous are taken as a group, and one MB row is collected from these batches of MB rows. MBs are selected, and the selected MBs are continuously input to one MB pipeline. Since these MBs are in a narrow image area, the image encoding device is used to display the reproduction pixels, motion vectors, and the like of the MBs adjacent to the upper and right upper MBs until the encoding of the MBs belonging to the lower adjacent MB row is completed. Even if it is held inside, the scale of the memory circuit required for the holding is small. By providing this storage circuit, except for the MB included in the uppermost MB row of the plurality of MB rows, the reproduction pixels, motion vectors, etc. of the upper adjacent MB and the upper right adjacent MB for encoding the current MB, etc. Can be solved.

なお、第1の実施形態〜第5の実施形態で示したMBパイプラインのステージ構成は一例であって、他のステージ構成とすることも可能である。そして、ステージ構成が変われば、ひとまとまりとして符号化する縦に連続する複数のMB行の数が同じであっても、動き検出やイントラ予測等における制約は変わる。 Note that the stage configuration of the MB pipeline shown in the first to fifth embodiments is an example, and other stage configurations may be used. If the stage configuration is changed, the constraints in motion detection, intra prediction, and the like change even if the number of vertically continuous MB rows encoded as a group is the same.

(第6の実施形態)
図20は、内部メモリを有する動画像符号化装置のブロック図である。動画像符号化装置23は、MBの符号化に必要な全てのデータを外部メモリ4から読み出してその内部メモリに記憶する。内部メモリは参照領域用メモリ14とバッファメモリ15の2種類ある。動き検出の時に参照される参照画像は参照領域用メモリ14に記憶され、参照領域用メモリ14から動き検出部16と動き補償部17に供給される。符号化のために必要なその他のデータはバッファメモリ15に記憶され、動き検出部16、動き補償部17、イントラ予測部18、整数変換・量子化・逆量子化・逆整数変換部19、可変長符号化部20、デブロッキングフィルタ部21はバッファメモリ15との間でデータを転送する。制御部22はイントラ・インター判定とレート制御を行う。制御部22はワイヤードロジックまたはマイクロプロセサで構成される。なお、図20では参照領域用メモリ14とバッファメモリ15を別々のものとして表わしたが、参照領域用アドレスとバッファ用アドレスが別れていれば1個の共通メモリであっても良い。
(Sixth embodiment)
FIG. 20 is a block diagram of a video encoding apparatus having an internal memory. The moving image encoding device 23 reads all data necessary for MB encoding from the external memory 4 and stores the data in the internal memory. There are two types of internal memory: a reference area memory 14 and a buffer memory 15. The reference image to be referred to at the time of motion detection is stored in the reference area memory 14 and is supplied from the reference area memory 14 to the motion detection unit 16 and the motion compensation unit 17. Other data necessary for encoding is stored in the buffer memory 15, and includes a motion detection unit 16, a motion compensation unit 17, an intra prediction unit 18, an integer transform / quantization / inverse quantization / inverse integer transform unit 19, a variable The long encoding unit 20 and the deblocking filter unit 21 transfer data to and from the buffer memory 15. The control unit 22 performs intra / inter determination and rate control. The control unit 22 is configured by a wired logic or a microprocessor. In FIG. 20, the reference area memory 14 and the buffer memory 15 are shown as separate ones. However, if the reference area address and the buffer address are separated, one common memory may be used.

図21は、縦に連続する4つのMB行に含まれる4個のMBを1個のMBパイプラインで処理する場合の参照領域を示した説明図である。参照領域28、29、30、31はそれぞれMB24、25、26、27の動き検出のときに参照される領域である。参照領域28、29、30、31は大きく重なっており、縦に隣り合うMB行に属する2個のMBの参照領域において重なっていない部分の高さはMBの縦方向の画素数と一致する。この重なり部分は動きベクトルの検出範囲が広くなるほど大きくなる。本実施形態において参照領域28、29、30、31中の全画素は、参照領域用メモリ14に記憶される。従来技術と同様に、本実施形態でも右方向に隣接するMBの符号化を開始するとき、外部メモリ4から参照領域用メモリ14へ更新領域32、33、34、35のみ転送し、それまで符号化していた左隣接MBの参照領域28、29、30、31の原点から次に符号化する右隣りのMBのための新しい原点に付け替える。ただし、MB25のための更新領域33は、MB24の参照領域28に含まれていない部分のみである。同様に、MB26とMB27の更新領域34、35はそれぞれMB25とMB26の参照領域29、30に含まれていない部分のみである。従って、従来技術に比べて、外部メモリ4と参照領域用メモリ14の間の画素転送量を大幅に削減することができる。 FIG. 21 is an explanatory diagram showing a reference area when four MBs included in four vertically continuous MB rows are processed by one MB pipeline. Reference areas 28, 29, 30, and 31 are areas that are referred to when motions of MBs 24, 25, 26, and 27 are detected, respectively. The reference areas 28, 29, 30, and 31 are greatly overlapped, and the height of the non-overlapping portions in the reference areas of the two MBs belonging to the vertically adjacent MB rows matches the number of pixels in the vertical direction of the MB. This overlapping portion becomes larger as the motion vector detection range becomes wider. In the present embodiment , all the pixels in the reference areas 28, 29, 30 and 31 are stored in the reference area memory 14. As in the prior art, in this embodiment , when encoding of the MB adjacent in the right direction is started, only the update areas 32, 33, 34, and 35 are transferred from the external memory 4 to the reference area memory 14, and the code is encoded up to that point. The origin of the reference area 28, 29, 30, 31 of the left adjacent MB that has been converted is changed to a new origin for the right adjacent MB to be encoded next. However, the update area 33 for the MB 25 is only a portion not included in the reference area 28 of the MB 24. Similarly, the update areas 34 and 35 of MB26 and MB27 are only portions not included in the reference areas 29 and 30 of MB25 and MB26, respectively. Therefore, the amount of pixel transfer between the external memory 4 and the reference area memory 14 can be greatly reduced as compared with the prior art.

図22は、参照領域用メモリに参照領域を記憶するもう一つの方法を示した説明図である。参照領域用メモリ14には、参照領域28、29、30、31を全て含む矩形の領域36を記憶する。この方法によれば、参照領域用メモリ14のアドレス生成が簡単になる。また、更新領域37もひとまとまりの矩形領域となるため、外部メモリ4から参照領域用メモリ14への画素の転送が簡単になる。 FIG. 22 is an explanatory diagram showing another method of storing the reference area in the reference area memory . The reference area memory 14 stores a rectangular area 36 that includes all the reference areas 28, 29, 30, and 31. According to this method, the address generation of the reference area memory 14 is simplified. Further, since the update area 37 is also a group of rectangular areas, transfer of pixels from the external memory 4 to the reference area memory 14 is simplified.

上記では、連続した4つのMB行に含まれる4つのMBを1個のMBパイプラインで同時に処理する場合を例として示したが、本実施形態に示す方法は連続した2以上のMB行であれば適用でき、例えば連続した8のMB行であっても良い。 In the above, the case where four MBs included in four consecutive MB rows are simultaneously processed by one MB pipeline has been shown as an example. However, the method shown in the present embodiment may be performed on two or more consecutive MB rows. For example, it may be eight consecutive MB lines.

なお、参照領域用メモリ14には単画素精度画像のみ記憶し、参照領域用メモリ14から読み出した単画素精度画像から動き検出部16と動き補償部17の内部で半画素精度画像や1/4画素精度画像を作成する構成とすることができる。この構成は、予め半画素精度画像や1/4画素精度画像を作成して外部メモリ4に記憶し、外部メモリ4から参照領域用メモリ14に半画素精度画像や1/4画素精度画像を転送する構成よりも外部メモリ4と参照領域用メモリ14の間の画素転送量を削減することができる。   The reference region memory 14 stores only a single pixel accuracy image, and the single pixel accuracy image read out from the reference region memory 14 is used to generate a half pixel accuracy image or ¼ inside the motion detection unit 16 and the motion compensation unit 17. It can be set as the structure which produces a pixel precision image. In this configuration, a half-pixel precision image or a quarter-pixel precision image is created in advance and stored in the external memory 4, and the half-pixel precision image or the quarter-pixel precision image is transferred from the external memory 4 to the reference area memory 14. The pixel transfer amount between the external memory 4 and the reference area memory 14 can be reduced as compared with the configuration to be performed.

また、2画素精度画像等の縮小画像を作成し、最初に縮小画像上で動き検出を行い、段階的に高精度画像で動き検出を行う階層的探索法がある。この探索法に対して本発明を適用する場合にも、参照領域用メモリ14には単画素精度画像のみを記憶しておき、動き検出部16と動き補償部17の内部で縮小画像を作成する構成とすることができる。この構成は、予め縮小画像を作成して外部メモリ4に記憶し、外部メモリ4から参照領域用メモリ14に縮小画像を転送する構成よりも外部メモリ4と参照領域用メモリ14の間の画素転送量を削減することができる。   Further, there is a hierarchical search method in which a reduced image such as a two-pixel accuracy image is created, motion is first detected on the reduced image, and motion detection is performed on the high-accuracy image step by step. Even when the present invention is applied to this search method, only the single-pixel precision image is stored in the reference area memory 14, and a reduced image is created inside the motion detection unit 16 and the motion compensation unit 17. It can be configured. This configuration creates a reduced image in advance and stores it in the external memory 4, and transfers pixels between the external memory 4 and the reference region memory 14 rather than a configuration in which the reduced image is transferred from the external memory 4 to the reference region memory 14. The amount can be reduced.

その他、動き検出における演算量を削減する手法としてテレスコピック探索法が提案されている。テレスコピック探索法では、符号化対象画像と参照画像の中間の画像も必要となる。この場合には、中間の画像の中で動き検出に必要な領域に対しても本実施形態に示す更新方法を適用することができる。 In addition, a telescopic search method has been proposed as a method for reducing the amount of calculation in motion detection. In the telescopic search method, an intermediate image between the encoding target image and the reference image is also required. In this case, it is also possible to apply the update method shown in the present embodiment, on the space required for the motion detection in the middle of the image.

また、輝度信号だけを本実施形態に示す方法で外部メモリ4から画像符号化装置23の内部メモリに転送しても良いし、輝度信号と色差信号の両方に本実施形態に示す方法を適用しても良い。なお、動き検出のときに色差信号を参照しない場合には、色差信号は参照領域用メモリ14とバッファメモリ15のどちらに記憶しても良い。 Also, it may be transferred from the external memory 4 into the internal memory of the image encoding device 23 in the manner shown only luminance signals in this embodiment, by applying the method shown in this embodiment for both the luminance signal and color difference signal May be. If the color difference signal is not referred to during motion detection, the color difference signal may be stored in either the reference area memory 14 or the buffer memory 15.

(第7の実施形態)
HDTV映像を符号化対象とする場合、良好な画質を得るために動きベクトルの範囲は横±200画素、縦±100画素程度必要である。この範囲の動きベクトルを検出するための演算量は膨大であり、動き検出のために多くのサイクル数を要する。しかし、MBパイプライン構造の動画像符号化装置では、MBサイクル当たりのサイクル数は全てのステージで共通である。動き検出のためのステージのみMBサイクル当たりのサイクル数を増加させることはできない。また、本発明を適用したMBパイプラインでは、処理結果をフィードバックできるステージ数に限界があるため、MBパイプラインのステージ数を増加させることは好ましくない。
(Seventh embodiment)
When HDTV video is to be encoded, the motion vector range needs to be about ± 200 pixels horizontally and ± 100 pixels vertically to obtain good image quality. The amount of calculation for detecting a motion vector in this range is enormous, and a large number of cycles are required for motion detection. However, in a moving picture encoding apparatus having an MB pipeline structure, the number of cycles per MB cycle is common to all stages. Only the stage for motion detection cannot increase the number of cycles per MB cycle. Also, in the MB pipeline to which the present invention is applied, there is a limit to the number of stages where the processing result can be fed back, so it is not preferable to increase the number of stages in the MB pipeline.

図23は広い範囲で動きを検出できる動き検出装置38と、本発明が適用されたMBパイプラインを含む動画像符号化装置23の組み合わせを示す。動き検出装置38は、動きベクトルの符号化コストを考慮せず、予測誤差の符号化コストのみを考慮して動きベクトル候補を検出する。動画像符号化装置23は、動き検出装置38で検出された動きベクトル候補を受け取って、その動きベクトル候補の周辺領域について動きベクトルの符号化コストまで考慮して動き検出を行う。すなわち、広い範囲でPMVを参照せずに動きを検出し、検出された動きベクトル候補の周辺領域についてPMVを参照して再度動き検出を行う。受け取った動きベクトル候補の周辺領域における再度の動き検出は2画素精度動き検出や単画素精度動き検出等任意の精度の動き検出段階で行うことが可能である。動画像符号化装置23では、この動きベクトル候補の周辺領域に加えて、コスト最小の動きベクトルが存在する可能性が高い他の領域、例えばPMVの周辺領域でも同時に動き検出を行っても良い。動き検出装置38は、動画像符号化装置23のMBパイプラインと無関係に動作するため、多くのサイクル数をかけて動き検出を行うことができる。   FIG. 23 shows a combination of a motion detection device 38 capable of detecting motion in a wide range and a moving image encoding device 23 including an MB pipeline to which the present invention is applied. The motion detection device 38 detects motion vector candidates in consideration of only the encoding cost of the prediction error without considering the encoding cost of the motion vector. The video encoding device 23 receives the motion vector candidate detected by the motion detection device 38 and performs motion detection in consideration of the motion vector encoding cost for the peripheral region of the motion vector candidate. That is, motion is detected without referring to the PMV over a wide range, and motion detection is performed again with reference to the PMV for the peripheral region of the detected motion vector candidate. The motion detection again in the peripheral region of the received motion vector candidate can be performed at a motion detection stage of any accuracy such as 2-pixel accuracy motion detection or single pixel accuracy motion detection. In the moving image encoding device 23, in addition to the peripheral region of the motion vector candidate, motion detection may be performed simultaneously in another region where there is a high possibility that a motion vector with the minimum cost exists, for example, the peripheral region of the PMV. Since the motion detection device 38 operates independently of the MB pipeline of the video encoding device 23, motion detection can be performed over many cycles.

また、動き検出装置38は、動画像符号化装置23で作成された再生画像ではなく、符号化されていない入力されたままの画像を対象として動き検出を行う構成とすることもできる。この構成とすることにより、動画像符号化装置23から動き検出装置38に再生画像を送る必要が無くなる。   In addition, the motion detection device 38 may be configured to perform motion detection on an input image that has not been encoded, but is not a reproduced image created by the video encoding device 23. With this configuration, it is not necessary to send a reproduced image from the moving image encoding device 23 to the motion detection device 38.

なお、動き検出装置38と動画像符号化装置23を同一のLSI上に集積することも可能である。この場合、動画像符号化装置23に接続されている外部メモリ4を動き検出装置38と動画像符号化装置23の共有メモリとし、動き検出装置38は再生画像を対象として動き検出を行う構成としても良い。   It is possible to integrate the motion detection device 38 and the moving image encoding device 23 on the same LSI. In this case, the external memory 4 connected to the video encoding device 23 is a shared memory of the motion detection device 38 and the video encoding device 23, and the motion detection device 38 performs motion detection on the reproduced image. Also good.

また、MPEG−2からH.264へトランスコードするときのように、既に検出された動きベクトルを利用できるときには、動き検出装置38を用いず、検出済の動きベクトルを直接動画像符号化装置23に入力し、この検出済み動きベクトルの周辺領域について動きベクトルの符号化コストまで考慮して動き検出を行う構成とすることもできる。   Also, MPEG-2 to H.264. When the already detected motion vector can be used as in the case of transcoding to H.264, the detected motion vector is directly input to the moving image encoding device 23 without using the motion detecting device 38, and this detected motion is detected. It is also possible to adopt a configuration in which motion detection is performed in consideration of the coding cost of the motion vector for the peripheral region of the vector.

(第8の実施形態)
2つの動画像符号化装置40、41と内部メモリ39を有する並列動画像符号化装置42のブロック図を図24に示す。図25は、動画像符号化装置40と41が符号化を分担するピクチャの領域を示す。i−MB行〜l−MB行、q−MB行〜t−MB行等を動画像符号化装置40が分担して符号化し、e−MB行〜h−MB行、m−MB行〜p−MB行等を動画像符号化装置41が分担して符号化する。このピクチャ分割方法によれば、動画像符号化装置40と41の分担するピクチャの領域が縦に連続しているため、両者の参照領域は縦に大きく重なっている。外部メモリ4から内部メモリ39へ2つの動画像符号化装置40と41の参照領域を転送し、内部メモリ39から個々の動画像符号化装置40と41に転送する構成とすれば、両者の参照領域の重なり部分を重複して転送する必要がないため、外部メモリ4と内部メモリ39の間のデータ転送量を削減することができる。
(Eighth embodiment)
FIG. 24 shows a block diagram of a parallel video encoding device 42 having two video encoding devices 40 and 41 and an internal memory 39. FIG. 25 shows a picture area in which the moving picture coding apparatuses 40 and 41 share the coding. The moving image encoding device 40 divides and encodes i-MB line to l-MB line, q-MB line to t-MB line, etc., and e-MB line to h-MB line, m-MB line to p The video encoding device 41 shares MB rows and the like and encodes them. According to this picture division method, since the picture areas shared by the moving picture coding apparatuses 40 and 41 are vertically continuous, the reference areas of both are greatly overlapped vertically. If the configuration is such that the reference areas of the two moving image encoding devices 40 and 41 are transferred from the external memory 4 to the internal memory 39 and are transferred from the internal memory 39 to the individual moving image encoding devices 40 and 41, both references are made. Since there is no need to transfer the overlapping portions of the areas in an overlapping manner, the amount of data transferred between the external memory 4 and the internal memory 39 can be reduced.

動画像符号化装置40と41に含まれるMBパイプラインの各ステージをMBが流れていく様子を図26に示す。各々の動画像符号化装置40と41のステージ構成は第1の実施形態の動画像符号化装置と同一である。ただし、例えば、l−MB行に属するMBの再生画素と動きベクトルを動画像符号化装置40から動画像符号化装置41に転送し、m−MB行に属するMBの符号化で参照することが可能である。このように、動画像符号化装置40と41の分担する領域の境界において、上隣接MBと右上隣接MBにおける再生画素や動きベクトル等現MBの参照するデータを転送できるタイミングで動画像符号化装置40と41を動作させる。このように動作させることにより、従来のスライスインタリーブと異なり、本実施形態の方法によれば、図25のi−MB行〜l−MB行やm−MB行〜p−MB行のように各動画像符号化装置40と41が分担して符号化する領域ごとにスライス分割する必要はなく、ピクチャ全体を1スライスとすることも可能である。更に、a−MB行〜d−MB行やe−MB行〜h−MB行等動画像符号化装置40と41が処理するピクチャの最初の領域が入力されると、動画像符号化装置40と41は符号化を開始することができるので、符号化遅延を抑えることができる。 FIG. 26 shows how the MB flows through each stage of the MB pipeline included in the moving image coding apparatuses 40 and 41. The stage configuration of each of the video encoding devices 40 and 41 is the same as that of the video encoding device of the first embodiment . However, for example, the reproduction pixel and motion vector of MB belonging to the l-MB row may be transferred from the moving image coding device 40 to the moving image coding device 41 and referred to in the coding of MB belonging to the m-MB row. Is possible. In this way, at the boundary between the regions shared by the moving image encoding devices 40 and 41, the moving image encoding device is at a timing at which data referred to by the current MB, such as reproduction pixels and motion vectors in the upper adjacent MB and the upper right adjacent MB, can be transferred. Operate 40 and 41. By such operation, unlike the conventional slice interleaving, according to the method of this embodiment, as i-MB row to l-MB row and m-MB row ~p-MB line in FIG. 25 each It is not necessary to divide the slices for each area to be encoded by the moving image coding apparatuses 40 and 41, and the entire picture can be made into one slice. Further, when the first area of the picture to be processed by the moving image encoding devices 40 and 41 such as the a-MB row to the d-MB row and the e-MB row to the h-MB row is input, the moving image encoding device 40 is input. And 41 can start encoding, so that encoding delay can be suppressed.

なお、並列動画像符号化装置42は3個以上の動画像符号化装置を含んでいても良い。   The parallel video encoding device 42 may include three or more video encoding devices.

(第9の実施形態)
H.264では可変長符号化の方法としてCABACを用いることができる。CABACは、1個の算術符号化回路を使用して1つのスライスに含まれる全MBを連続的に処理する。一方、第1の実施形態〜第8の実施形態に記載した発明では、縦に連続する複数のMB行をひとまとまりとして、これらひとまとまりのMB行から、1つのMB行当たり1個のMBを選択し、これら選択された複数のMBを1個のMBパイプラインに連続して投入する。このため、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了した後でなければ2値化シンボルを算術符号化することができない。しかし、あるMBを符号化したとき、その発生符号量が著しく多い場合がある。このような場合、早急に量子化パラメータを大きくし、新たに符号化するMBから発生する符号量を減少させるようにレート制御しなければならない。本実施形態では、第1の実施形態〜第8の実施形態に記載した発明が適用された動画像符号化装置においてH.264で規定されるCABAC等の算術符号化を行う場合に、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行う方法を示す。
(Ninth embodiment)
H. In H.264, CABAC can be used as a variable length coding method. CABAC continuously processes all MBs included in one slice by using one arithmetic coding circuit. On the other hand, in the inventions described in the first to eighth embodiments , a plurality of MB rows that are vertically continuous are taken as a group, and one MB per MB row is obtained from the batch of MB rows. A plurality of selected MBs are continuously input to one MB pipeline. For this reason, the binary symbols cannot be arithmetically encoded unless encoding of all MBs included in a group of MBs that are vertically continuous is completed. However, when a certain MB is encoded, the generated code amount may be remarkably large. In such a case, it is necessary to increase the quantization parameter immediately and control the rate so as to reduce the amount of code generated from the newly encoded MB. In the present embodiment, H.264 is applied to the moving picture coding apparatus to which the inventions described in the first to eighth embodiments are applied. In the case of performing arithmetic coding such as CABAC defined in H.264, a method is shown in which rate control is performed before the coding of all MBs included in a group of MBs that are vertically continuous is completed.

2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定する方法がある。この方法によって推定される発生符号量によってレート制御を行えば、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化終了を待たずにレート制御することができる。図27は、推定発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。 There is a method for estimating the generated code amount of arithmetic coding from the total symbol length of binary symbols . If rate control is performed based on the generated code amount estimated by this method, rate control can be performed without waiting for the completion of encoding of all MBs included in a group of MBs that are vertically continuous. FIG. 27 is a block diagram of a CABAC encoder that performs rate control based on the estimated generated code amount.

まず、シンタックスデータを2値化回路43により2値化する。2値化回路43は、ルックアップテーブルを含み、テーブルルックアップを用いて2値化シンボルへの変換を1サイクルで行う。そして、発生符号量推定回路44により変換された2値化シンボルのシンボル長の総和からMBごとの発生符号量を推定し、制御部22に推定発生符号量を送ってレート制御を行う。これにより、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前にレート制御を行うことができる。   First, the syntax data is binarized by the binarization circuit 43. The binarization circuit 43 includes a look-up table, and performs conversion into a binarized symbol in one cycle using the table look-up. Then, the generated code amount for each MB is estimated from the sum of the symbol lengths of the binarized symbols converted by the generated code amount estimation circuit 44, and the estimated generated code amount is sent to the control unit 22 for rate control. As a result, rate control can be performed before the encoding of all MBs included in a group of MBs that are vertically continuous is completed.

ここで、本発明が適用された動画像符号化装置では、MB行の先頭のMBを処理するとき、その上に隣り合ったMB行の最後のMBの量子化パラメータはまだ求まっていない。しかし、量子化パラメータは直前に符号化したMBの量子化パラメータとの差分が2値化され、算術符号化される。そこで、MB行内の先頭のMBの量子化パラメータについては仮の値との差分(以下、仮mb_qp_deltaという。)を2値化するものとする。なお、仮の値は、既に符号化済みのMBの量子化パラメータを参照して上に隣り合うMB行内の最後のMBの量子化パラメータを推測して決定することが望ましい。一方、MB行内の先頭以外のMBの量子化パラメータは、H.264で規定されている通り、直前に符号化した左隣接MBのものとの差分(以下、mb_qp_deltaという。)を2値化する。   Here, in the moving picture encoding apparatus to which the present invention is applied, when the first MB of the MB row is processed, the quantization parameter of the last MB of the MB row adjacent to it is not yet determined. However, the difference between the quantization parameter and the quantization parameter of the MB encoded immediately before is binarized, and arithmetic coding is performed. Thus, the quantization parameter of the first MB in the MB row is binarized from the temporary value (hereinafter referred to as temporary mb_qp_delta). The provisional value is desirably determined by referring to the quantization parameter of the already encoded MB and estimating the quantization parameter of the last MB in the MB row adjacent above. On the other hand, the quantization parameters of MBs other than the head in the MB row are H.264. As defined in H.264, the difference (hereinafter referred to as mb_qp_delta) from the left adjacent MB encoded immediately before is binarized.

次に、2値化シンボルをいったん2値化シンボル記憶回路45で記憶し、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了した後、2値化シンボルを2値化シンボル記憶回路45から読み出す。そして、コンテクスト情報復元回路47を用いてそれに対応するコンテクスト情報を復元しながら、算術符号化回路46により算術符号化を行う。コンテクスト情報復元回路47の処理は、動画像復号装置で使用されるCABAC復号回路内のコンテクスト情報復元処理とほぼ同一である。コンテクスト情報復元回路47の処理フローを図28に示す。スライスの先頭でコンテクスト情報を初期化する(ステップS5)。次に、変数tmpをクリアし(ステップS6)、シンタックスデータの2値化シンボルを1個取得する(ステップS7)。その後、算術符号化するsymbolのコンテクスト情報を取得し(ステップS8)、2値化シンボル記憶回路45からsymbolを1ビット読み出す(ステップS9)。そして、コンテクスト情報とsymbolを算術符号化回路46に出力する(ステップS10)。変数tmpを1ビット左論理シフトした後、LSBにsymbolを連結する(ステップS11)。この新たなtmpがステップS7で取得した2値化シンボルと異なる場合にはステップS8に戻る(ステップS12)。tmpが2値化シンボルと一致する場合にはスライスの最後か否か判定し、スライスの最後でない場合にはステップS6に戻り(ステップS13)、tmpをクリアするとともに新たな2値化シンボルを取得する(ステップS6、S7)。スライスの最後である場合にはコンテクスト情報復元処理を終了する(ステップS13)。   Next, the binarized symbols are temporarily stored in the binarized symbol storage circuit 45, and after the encoding of all MBs included in a group of MBs that are vertically continuous is completed, the binarized symbols are binarized. Read out from the symbol storage circuit 45. Then, the arithmetic coding circuit 46 performs arithmetic coding while restoring the context information corresponding to the context information restoring circuit 47. The processing of the context information restoration circuit 47 is almost the same as the context information restoration processing in the CABAC decoding circuit used in the video decoding device. The processing flow of the context information restoration circuit 47 is shown in FIG. Context information is initialized at the head of the slice (step S5). Next, the variable tmp is cleared (step S6), and one binarized symbol of syntax data is acquired (step S7). Thereafter, the symbol context information to be arithmetically encoded is acquired (step S8), and 1 bit of symbol is read from the binarized symbol storage circuit 45 (step S9). Then, the context information and symbol are output to the arithmetic encoding circuit 46 (step S10). After the variable tmp is logically shifted by 1 bit to the left, symbol is connected to LSB (step S11). If the new tmp is different from the binarized symbol acquired in step S7, the process returns to step S8 (step S12). If tmp matches the binarized symbol, it is determined whether or not it is the end of the slice. If it is not the end of the slice, the process returns to step S6 (step S13) to clear tmp and obtain a new binarized symbol. (Steps S6 and S7). If it is the end of the slice, the context information restoration process is terminated (step S13).

ただし、MB行内の先頭のMBの仮mb_qp_deltaを2値化シンボル記憶回路45に記憶し、コンテクスト情報復元回路47でMB行内の先頭のMBの量子化パラメータを再現することとすると、上に隣り合うMB行内の最後のMBの量子化パラメータを再現し、それとの差分を算出して実際のmb_qp_deltaを求めた後、再度2値化し、算術符号化しなければならない。その際、そのMB行に含まれる全てのMBについてmb_qp_deltaを復号して量子化パラメータを再現することが必要となる。これを避けるために、MB行内の最後のMBについてはmb_qp_deltaとともに量子化パラメータそのものを2値化シンボル記憶回路45に記憶することとしても良い。MB行内の最後のMBの量子化パラメータを一定のビット長として記憶することにより、コンテクスト情報復元回路47でMB行内の最後のMBの量子化パラメータと識別することができる。 However, the temporary mb_qp_delta of the first MB in the MB row is stored in the binarized symbol storage circuit 45, and the quantization parameter of the first MB in the MB row is reproduced by the context information restoration circuit 47. After the quantization parameter of the last MB in the MB row is reproduced and the difference from the parameter is calculated to obtain the actual mb_qp_delta, it must be binarized again and arithmetically encoded. At that time, it is necessary to reproduce the quantization parameter by decoding mb_qp_delta for all MBs included in the MB row . In order to avoid this, the quantization parameter itself may be stored in the binarized symbol storage circuit 45 together with mb_qp_delta for the last MB in the MB row. By storing the quantization parameter of the last MB in the MB row as a constant bit length, the context information restoration circuit 47 can identify the quantization parameter of the last MB in the MB row.

なお、2値化シンボル記憶回路45は動画像符号化装置内部に無くても良く、外部メモリ4に2値化シンボルを記憶することとしても良い。   Note that the binarized symbol storage circuit 45 may not be provided in the moving image encoding apparatus, and the binarized symbols may be stored in the external memory 4.

本実施形態の方法には、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができるという利点がある。特に、2値化シンボル記憶回路45にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路46にIピクチャの2値化シンボル発生量を処理できるだけの性能を持たせる必要はなく、複数ピクチャの2値化シンボルの平均発生量を処理できるだけの性能を持たせれば足りるという利点がある。 The method of this embodiment has the advantage that it is possible to arithmetic coding without arithmetic coding circuit have a capability enough to handle binary symbol generation amount increases suddenly. In particular, if the binarized symbol storage circuit 45 has a sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the arithmetic coding circuit 46 is provided. There is an advantage that it is not necessary to have a performance sufficient to process the binarized symbol generation amount of an I picture, and it is sufficient to have a performance sufficient to process an average generation amount of binarized symbols of a plurality of pictures.

(第10の実施形態)
本実施形態では、CABACを用いる動画像符号化装置に本発明を適用する場合における第9の実施形態とは別のレート制御方法を示す。図29は、仮の発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。2値化シンボルをいったん2値化シンボル記憶回路45に記憶し、2値化シンボル記憶回路45から読み出してそれに対応するコンテクスト情報を復元しながら算術符号化(以下、真の算術符号化という。)を行う点については第9の実施形態と同じである。本実施形態では、2値化シンボルを仮算術符号化回路48により仮算術符号化して仮の発生符号量を算出し、縦に連続するひとまとまりのMB行に含まれる全てのMBの符号化が終了する前に仮の発生符号量に基づいてレート制御する点が異なる。
(Tenth embodiment)
In the present embodiment, a rate control method different from that in the ninth embodiment in the case where the present invention is applied to a moving image encoding apparatus using CABAC is shown. FIG. 29 is a block diagram of a CABAC encoder that performs rate control based on a provisional generated code amount. The binary symbol is temporarily stored in the binary symbol storage circuit 45, and is read out from the binary symbol storage circuit 45 to perform arithmetic coding while restoring the corresponding context information (hereinafter referred to as true arithmetic coding). The point of performing is the same as in the ninth embodiment . In this embodiment, the binarized symbol is temporarily arithmetic coding by the temporary arithmetic coding circuit 48 calculates the generated code amount of temporary, vertical to the encoding of all the MB included in the MB row of human unity the successive The difference is that the rate is controlled based on the provisional generated code amount before the end.

MB行内の先頭のMBでは、通常上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行う。しかし、本発明では縦に連続する複数のMB行をひとまとまりとして符号化を進めるため、MB行内の先頭のMBを符号化するとき上に隣り合うMB行内の最後のMBは符号化が終わっていない。このため、縦に連続するひとまとまりのMB行の符号化が終了するまで、上に隣り合うMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継いで算術符号化を行うことができない。そこで、MB行内の先頭のMBについては仮の値をrange、low、および確率テーブルに設定して仮算術符号化を開始する。   In the first MB in the MB row, arithmetic coding is performed by taking over the range, low, and probability table when the arithmetic coding of the last MB in the adjacent MB row is finished. However, in the present invention, since encoding is performed with a plurality of vertically continuous MB rows as a group, when the first MB in the MB row is encoded, the last MB in the adjacent MB row is already encoded. Absent. For this reason, until encoding of a group of consecutive MB rows is completed, the arithmetic is performed by taking over the range, low, and probability table when the arithmetic encoding of the last MB in the adjacent MB row is finished. Encoding cannot be performed. Therefore, for the first MB in the MB row, provisional values are set in the range, low, and probability tables, and provisional arithmetic coding is started.

縦に連続する4つのMB行をひとまとまりとして符号化を行う場合の仮算術符号化回路48のブロック図を図30に示す。コンテクスト計算部49はsymbolごとにコンテキスト計算を行う。rangeを記憶する部分51〜54、lowを記憶する部分55〜58、および確率テーブル59〜62は4つのMB行に対応して4個づつ存在する。range(n)記憶部分51、low(n)記憶部分55、および確率テーブル(n)59は4つのMB行のうち最も上のMB行に対応する。range(n+1)記憶部分52、low(n+1)記憶部分56、および確率テーブル(n+1)60は上から2番目のMB行に対応する。そして、range(n+2)記憶部分53、low(n+2)記憶部分57、および確率テーブル(n+2)61は上から3番目のMB行に対応し、range(n+3)記憶部分54、low(n+3)記憶部分58、および確率テーブル(n+3)62は最も下のMB行に対応する。rangeを記憶する部分51〜54とlowを記憶する部分55〜58の内容は、4つのMB行に含まれる個々のMBの算術符号化を開始するときのみ算術符号化部50に読み込まれ、そのMBの算術符号化を終了するとき算術符号化部50から書き込まれ更新される。 FIG. 30 shows a block diagram of the provisional arithmetic encoding circuit 48 when encoding is performed with a group of four vertically continuous MB rows as a group. The context calculation unit 49 performs context calculation for each symbol. There are four portions 51 to 54 for storing a range, portions 55 to 58 for storing a low, and probability tables 59 to 62 corresponding to four MB rows. The range (n) storage portion 51, the low (n) storage portion 55, and the probability table (n) 59 correspond to the uppermost MB row of the four MB rows. The range (n + 1) storage portion 52, the low (n + 1) storage portion 56, and the probability table (n + 1) 60 correspond to the second MB row from the top. The range (n + 2) storage portion 53, the low (n + 2) storage portion 57, and the probability table (n + 2) 61 correspond to the third MB row from the top, the range (n + 3) storage portion 54, and the low (n + 3) storage. Portion 58 and probability table (n + 3) 62 correspond to the bottom MB row. The contents of the parts 51 to 54 for storing the range and the parts 55 to 58 for storing the low are read into the arithmetic encoding unit 50 only when the arithmetic encoding of individual MBs included in the four MB rows is started. When the arithmetic coding of MB is finished, it is written and updated from the arithmetic coding unit 50 .

MB行内の先頭のMBについて仮のrange、low、および確率テーブルを設定する方法として3つ考えられる。最初の方法は、H.264で規定されている初期化を行う方法である。H.264ではスライスの先頭でrange、low、および確率テーブルを初期化する。MB行内の先頭のMBについて仮算術符号化を開始するとき、この初期化を行う。   There are three possible methods for setting a temporary range, low, and probability table for the first MB in the MB row. The first method is described in H.W. This is a method of performing initialization defined in H.264. H. H.264 initializes the range, low, and probability tables at the beginning of the slice. This initialization is performed when provisional arithmetic coding is started for the first MB in the MB row.

2番目の方法は、縦に連続するひとまとまりのMB行内の個々のMB行ごとに、MB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを、その下に隣接するひとまとまりのMB行内の対応するMB行における先頭MBに引き継ぐ方法である。縦に連続する4つのMB行をひとまとまりとして符号化を行う場合を図31に示す。図31は12のMB行で構成されるピクチャを示す。ピクチャの最も上のひとまとまりの4つのMB行については、個々のMB行内の最初のMBのrange、low、および確率テーブルはH.264で規定されている方法で初期化する。上から2番目のひとまとまりの4つのMB行に含まれる個々のMB行については、最も上のひとまとまりの4つのMB行に含まれる個々のMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継ぐ。同様に、上から3番目のひとまとまりの4つのMB行については、上から2番目のひとまとまりの4つのMB行に含まれる個々のMB行内の最後のMBの算術符号化が終えたときのrange、low、および確率テーブルを引き継ぐ。   In the second method, the range, low, and probability tables when the last MB in the MB row has been arithmetically encoded for each MB row in a group of vertically contiguous MB rows are This is a method of taking over to the first MB in a corresponding MB row in a group of adjacent MBs. FIG. 31 shows a case where encoding is performed with a group of four vertically continuous MB rows. FIG. 31 shows a picture composed of 12 MB rows. For the top four batches of MB in the picture, the range, low, and probability table of the first MB in each MB row is H.264. It is initialized by the method specified in H.264. For the individual MB rows included in the four MB rows in the second batch from the top, the arithmetic encoding of the last MB in the individual MB rows included in the uppermost four MB rows has been completed. Take over the time range, low, and probability table. Similarly, for the 4 MB rows in the third batch from the top, the arithmetic encoding of the last MB in each MB row included in the 4 MB rows in the second batch from the top is finished. Take over the range, low, and probability tables.

3番目の方法は、既に真の算術符号化を終了したピクチャの同じ位置にあるMBが引き継いだrange、low、および確率テーブルと同じものを、MB行内の先頭のMBにおける仮のrange、low、および確率テーブルとして設定する方法である。   The third method is the same as the range, low, and probability table inherited by the MB at the same position in the picture that has already been subjected to true arithmetic coding, and the temporary range, low, And setting as a probability table.

あるMBを符号化しているとき2値化シンボルが突発的に増加し、仮算術符号化回路48の処理能力を超えたときは、そのMBについては途中で仮算術符号化を打ち切り、次のMBの仮算術符号化を開始しても良い。2値化シンボルの発生量が急激に増大した場合には、第9の実施形態と同様に2値化シンボルの発生量により発生符号量を推定し、これから符号化するMBの量子化パラメータを大きくし、2値化シンボルの発生量を減少させる等の方法によりレート制御を行うことができる。このため、突発的に発生する2値化シンボルの最大発生量を処理できるだけの性能を仮算術符号化回路48に持たせる必要はない。また、本実施形態の方法でも、第9の実施形態の方法同様、2値化シンボル記憶回路45に十分な記憶容量を持たせれば、真の算術符号化回路46に複数ピクチャの2値化シンボルの平均発生量を処理できるだけの性能を持たせれば足りるという利点がある。 When a certain MB is encoded, the binarized symbols suddenly increase, and when the processing capacity of the provisional arithmetic encoding circuit 48 is exceeded, provisional arithmetic encoding is aborted on the way to the next MB. The provisional arithmetic coding may be started. When the generation amount of binarized symbols increases rapidly, the generated code amount is estimated from the generation amount of binarized symbols as in the ninth embodiment, and the quantization parameter of the MB to be encoded is increased. In addition, rate control can be performed by a method such as reducing the amount of binarized symbols generated. For this reason, it is not necessary to give the provisional arithmetic coding circuit 48 enough performance to handle the maximum amount of binarized symbols that occur unexpectedly. Also in the method of the present embodiment, as in the method of the ninth embodiment , if the binarized symbol storage circuit 45 has a sufficient storage capacity, the true arithmetic coding circuit 46 has a plurality of picture binarized symbols. There is an advantage that it is sufficient to have a performance sufficient to process the average generation amount.

仮算術符号化回路48を複数設けることもできる。図32は、2並列で仮算術符号化を行う場合の仮算術符号化回路68のブロック図である。コンテクスト計算部49と算術符号化部50を2個づつ有する。一方の算術符号化部50には、range(n)記憶部分51、low(n)記憶部分55、確率テーブル(n)59、range(n+2)記憶部分53、low(n+2)記憶部分57、および確率テーブル(n+2)61が接続されており、ひとまとまりの4つのMB行のうち最も上のMB行と上から3番目のMB行に含まれるMBを仮算術符号化する。また、もうひとつの算術符号化部50には、range(n+1)記憶部分52、low(n+1)記憶部分56、確率テーブル(n+1)60、range(n+3)記憶部分54、low(n+3)記憶部分58、および確率テーブル(n+3)62が接続されており、ひとまとまりの4つのMB行のうち上から2番目のMB行と最も下のMB行に含まれるMBを仮算術符号化する。第1の実施形態と類似したMBパイプラインのステージ構成において、図1中のe行10列、f行8列、g行6列、h行4列のMBが各ステージを流れていく様子を図33に示す。このように、2並列で仮算術符号化を行うことにより、1つのMBの仮算術符号化を2MBサイクルかけて行うことができる。なお、図32中のメモリ63、65とメモリ64、66はそれぞれ2値化シンボルとシンタックッスデータを2MBサイクル保持するために設けられている。 A plurality of provisional arithmetic encoding circuits 48 may be provided. FIG. 32 is a block diagram of the provisional arithmetic coding circuit 68 when provisional arithmetic coding is performed in two parallel. Two context calculation units 49 and two arithmetic coding units 50 are provided. One arithmetic encoding unit 50 includes a range (n) storage portion 51, a low (n) storage portion 55, a probability table (n) 59, a range (n + 2) storage portion 53, a low (n + 2) storage portion 57, and A probability table (n + 2) 61 is connected, and provisional arithmetic coding is performed on the MBs included in the uppermost MB row and the third MB row from the top among a group of four MB rows. The other arithmetic encoding unit 50 includes a range (n + 1) storage portion 52, a low (n + 1) storage portion 56, a probability table (n + 1) 60, a range (n + 3) storage portion 54, and a low (n + 3) storage portion. 58 and a probability table (n + 3) 62 are connected, and provisional arithmetic coding is performed on the MBs included in the second MB row from the top and the lowest MB row among a group of four MB rows. In the MB pipeline stage configuration similar to that of the first embodiment , a state in which the MB of e row 10 column, f row 8 column, g row 6 column, h row 4 column in FIG. 1 flows through each stage. As shown in FIG. Thus, by performing provisional arithmetic coding in two parallels, provisional arithmetic coding of one MB can be performed over 2 MB cycles. Note that the memories 63 and 65 and the memories 64 and 66 in FIG. 32 are provided to hold binary symbols and syntax data for 2 MB cycles, respectively.

第9の実施形態の方法は、直前の符号化済みピクチャの2 値化シンボル長と発生符号量との比率αが必要である。このため、シーンチェンジ等があった場合、発生符号量の推定が不正確となる。一方、本実施形態の方法は、同一MB行内のMBの算術符号化が行われるにつれて仮算術符号化に用いられる確率テーブルの値が正確なものに収束する。このため、シーンチェンジ等があった場合でも真の算術符号化による発生符号量に基づくレート制御に近いレート制御を行うことができる。 The method of the ninth embodiment requires a ratio α between the binary symbol length of the immediately previous encoded picture and the generated code amount. For this reason, when there is a scene change or the like, the estimation of the generated code amount becomes inaccurate. On the other hand, the method of the present embodiment, the value of the probability table used for temporary arithmetic coding as arithmetic coding of the same MB row MB is made to converge to accurate. For this reason, even when there is a scene change or the like, it is possible to perform rate control close to rate control based on the generated code amount by true arithmetic coding.

(第11の実施形態)
シンタックスデータを2値化以外の方法で圧縮していったん記憶した後、シンタックスデータを復元して2値化、算術符号化することもできる。例えば、H.264ではCABACの他にCAVLCも可変長符号化方式として規定されているが、CAVLCは1個のシンタックスデータを1CKで可変長符号化することができる。CAVLCで圧縮する場合のCABAC符号化器のブロック図を図34に示す。シンタックスデータをCAVLC符号化回路69で圧縮して発生したCAVLC符号化ビットストリームをCAVLC符号化ビットストリーム記憶回路70にいったん記憶する。そして、CAVLC符号化ビットストリーム記憶回路70から読み出したCAVLC符号化ビットストリームをCAVLC復号回路71で復号し、復元されたシンタックスデータを2値化回路43により2値化し、算術符号化回路46により算術符号化する。なお、図34には、仮算術符号化を行い、仮発生符号量でレート制御する場合を示したが第9の実施形態で示したように、2値化シンボルのシンボル長の総和から算術符号化の発生符号量を推定し、レート制御しても良い。
(Eleventh embodiment)
After the syntax data is compressed by a method other than binarization and temporarily stored, the syntax data can be restored and binarized or arithmetically encoded. For example, H.M. In H.264, in addition to CABAC, CAVLC is defined as a variable-length encoding method, but CAVLC can variable-code one piece of syntax data with 1 CK. FIG. 34 shows a block diagram of a CABAC encoder when compressed by CAVLC. The CAVLC encoded bit stream generated by compressing the syntax data by the CAVLC encoding circuit 69 is temporarily stored in the CAVLC encoded bit stream storage circuit 70. Then, the CAVLC encoded bit stream read from the CAVLC encoded bit stream storage circuit 70 is decoded by the CAVLC decoding circuit 71, the restored syntax data is binarized by the binarizing circuit 43, and the arithmetic encoding circuit 46 Perform arithmetic coding. Although FIG. 34, the tentative arithmetic coding was carried out, as has been shown a case where the rate control in the tentative generated code amount shown in the ninth embodiment, arithmetic coding from the sum of the symbol length of the binary symbol The amount of generated code may be estimated and the rate may be controlled.

ここで、第9の実施形態で指摘したように、本発明が適用された動画像符号化装置では、MB行の先頭のMBを処理するとき、その上に隣り合ったMB行の最後のMBの量子化パラメータはまだ求まっていない。そこで、第9の実施形態と同様に、MB行内の先頭のMBの量子化パラメータについては仮の値との差分(以下、仮mb_qp_deltaという。)をCAVLCで符号化し、MB行内の先頭以外のMBの量子化パラメータは直前に符号化した左隣接MBのものとの差分(以下、mb_qp_deltaという。)をCAVLCで符号化するものとする。そして、MB行内の先頭のMBの量子化パラメータについては、上隣接MB行内の最後のMBの量子化パラメータを再現し、それとの差分を算出して実際のmb_qp_deltaを求めた後、2値化し、算術符号化する。その際、全てのMBについてmb_qp_deltaを復号して量子化パラメータを再現することを避けるために、MB行内の最後のMBについてmb_qp_deltaとともに量子化パラメータそのものをCAVLC符号化ビットストリーム記憶回路70に記憶することとしても良い。 Here, as pointed out in the ninth embodiment , in the video encoding apparatus to which the present invention is applied, when processing the first MB of the MB row, the last MB of the adjacent MB row is processed. The quantization parameter of is not yet determined. Therefore, as in the ninth embodiment , the difference between the quantization parameter of the first MB in the MB row and the temporary value (hereinafter referred to as temporary mb_qp_delta) is encoded by CAVLC, and the MBs other than the first MB in the MB row are encoded. As for the quantization parameter of, the difference (hereinafter referred to as mb_qp_delta) from that of the left adjacent MB encoded immediately before is encoded by CAVLC. Then, with respect to the quantization parameter of the first MB in the MB row, the quantization parameter of the last MB in the upper adjacent MB row is reproduced, and the difference between them is calculated to obtain the actual mb_qp_delta, and then binarized. Perform arithmetic coding. At that time, in order to avoid decoding mb_qp_delta for all MBs and reproducing the quantization parameter, the quantization parameter itself is stored in the CAVLC encoded bitstream storage circuit 70 together with mb_qp_delta for the last MB in the MB row. It is also good.

シンタックスデータを圧縮し、復元できる可逆圧縮方法であれば、CAVLC以外の方法を用いることもできる。すなわち、シンタックスデータを可逆圧縮して圧縮されたシンタックスデータをいったん記憶する。そして、この圧縮されたシンタックスデータを読み出してシンタックスデータを復元する。この復元されたシンタックスデータを2値化シンボルに変換し、算術符号化する。   Any method other than CAVLC can be used as long as it is a reversible compression method capable of compressing and restoring syntax data. That is, syntax data compressed by lossless compression of syntax data is temporarily stored. Then, the compressed syntax data is read to restore the syntax data. The restored syntax data is converted into a binary symbol and arithmetically encoded.

H.264では、entropy_coding_mode_flagを指定することにより、ピクチャごとにCAVLCとCABACを切り替えることができる。そこで、可逆圧縮方法としてCAVLCを用いる場合には、あるMBの2値化シンボルの発生量が突発的に増加し、仮算術符号化した結果真の算術符号化回路46の処理能力を超えると予測されるとき、そのMBを含むピクチャ全体をCAVLC符号化し、一方、仮算術符号化した結果真の算術符号化回路46で処理できると予測されるとき、そのMBを含むピクチャ全体をCABAC符号化することができる。これにより、真の算術符号化回路46の性能が不測するという状況を確実に回避できる。   H. In H.264, CAVLC and CABAC can be switched for each picture by specifying entropy_coding_mode_flag. Therefore, when CAVLC is used as the lossless compression method, the amount of binarized symbols generated for a certain MB suddenly increases, and it is predicted that the processing capacity of the true arithmetic encoding circuit 46 will be exceeded as a result of provisional arithmetic encoding. The entire picture including the MB is CAVLC encoded, and when the result of provisional arithmetic encoding is predicted to be processed by the true arithmetic encoding circuit 46, the entire picture including the MB is CABAC encoded. be able to. As a result, a situation in which the performance of the true arithmetic coding circuit 46 is unexpected can be surely avoided.

また、CAVLC符号化回路69でCAVLC符号化ビットストリームの符号量を算出し、CAVLC符号化と仮算術符号化の仮発生符号量を比較して、ピクチャごとに発生符号量が少ないと推測されるエントロピー符号化モードを選択することもできる。   Further, the CAVLC encoding circuit 69 calculates the code amount of the CAVLC encoded bit stream, and compares the CAVLC encoding and the provisional generated code amount of the provisional arithmetic encoding, and it is estimated that the generated code amount is small for each picture. An entropy coding mode can also be selected.

(第12の実施形態)
本実施形態では、第8の実施形態で示した2つの動画像符号化装置40と41で構成される並列動画像符号化装置42からCABACで符号化された1本のビットストリームを生成する方法を示す。動画像符号化装置40と41から2値化シンボルが出力される並列動画像符号化装置のブロック図を図35に示す。動画像符号化装置40と41から出力される2値化シンボルを共通の2値化シンボル記憶回路45にいったん記憶する。そして、2値化シンボルを2値化シンボル記憶回路45から読み出し、コンテクスト情報復元回路47を用いてそれに対応するコンテクスト情報を復元しながら、算術符号化回路46により算術符号化を行う。
(Twelfth embodiment)
In the present embodiment , a method of generating one bit stream encoded by CABAC from the parallel video encoding device 42 composed of the two video encoding devices 40 and 41 shown in the eighth embodiment. Indicates. FIG. 35 shows a block diagram of a parallel moving image encoding device in which binarized symbols are output from the moving image encoding devices 40 and 41. The binarized symbols output from the moving image encoding devices 40 and 41 are temporarily stored in the common binarized symbol storage circuit 45. A binary symbol is read from the binary symbol storage circuit 45, and arithmetic coding is performed by the arithmetic coding circuit 46 while restoring the corresponding context information using the context information restoration circuit 47.

また、動画像符号化装置40と41からCAVLC符号化ビットストリームが出力される並列動画像符号化装置のブロック図を図36に示す。動画像符号化装置40と41から出力されるCAVLC符号化ビットストリームを共通のCAVLC符号化ビットストリーム記憶回路70にいったん記憶する。そして、CAVLC符号化ビットストリームをCAVLC符号化ビットストリーム記憶回路70から読み出し、CAVLC復号回路71により復号してシンタックスデータに戻した後、そのシンタックスデータを2値化し、算術符号化を行う。   FIG. 36 shows a block diagram of a parallel moving image encoding apparatus in which a CAVLC encoded bit stream is output from the moving image encoding apparatuses 40 and 41. The CAVLC encoded bit stream output from the moving image encoding devices 40 and 41 is temporarily stored in the common CAVLC encoded bit stream storage circuit 70. Then, the CAVLC encoded bit stream is read from the CAVLC encoded bit stream storage circuit 70, decoded by the CAVLC decoding circuit 71 and returned to syntax data, and then the syntax data is binarized and subjected to arithmetic encoding.

なお、並列動画像符号化装置42は3個以上の動画像符号化装置を含んでいても良い。   The parallel video encoding device 42 may include three or more video encoding devices.

(第13の実施形態)
H.264のMBAFF(Macroblock Adaptive Frame Field Coding)では、縦に隣接する2つのMBをペア(以下、MBペアという。)とし、16画素×32ラインごとにフィールド符号化とフレーム符号化を切り替えて符号化する。フィールド符号化とフレーム符号化のときのMBペアを図37に示す。図37(a)はフィールド符号化のときのMBペアである。32ラインの画素のうち、奇数ラインでトップフィールドMB72を構成し、偶数ラインでボトムフィールドMB73を構成する。また、図37(b)はフレーム符号化のときのMBペアである。32ラインのうち、上半分の16ラインで上フレームMB74を構成し、下半分の16ラインで下フレームMB75を構成する。トップフィールドMB72とボトムフィールドMB73はお互いに隣接MBの関係にないが、上フレームMB74は下フレームMB75に対して上隣接MBの関係にある。このため、フレーム符号化が選択された場合、下フレームMB75のPMVは上フレームMB74のイントラ/インター判定結果を考慮して決定しなければならないという制限がある。また、下フレームMB75のイントラ予測は上フレームMB74の再生画素を用いるため、上フレームMB74について動き補償が行われ、再生画素が作成されなければ、下フレームMB75についてイントラ予測を行うことができないという制限がある。
(13th Embodiment)
H. In H.264 MBAFF (Macroblock Adaptive Frame Field Coding), two vertically adjacent MBs are paired (hereinafter referred to as MB pairs), and encoding is performed by switching between field encoding and frame encoding every 16 pixels × 32 lines. To do. An MB pair at the time of field coding and frame coding is shown in FIG. FIG. 37A shows an MB pair at the time of field coding. Of the 32 lines of pixels, odd lines constitute the top field MB72, and even lines constitute the bottom field MB73. FIG. 37B shows an MB pair at the time of frame coding. Of the 32 lines, the upper half 16 lines constitute the upper frame MB74, and the lower half 16 lines constitute the lower frame MB75. The top field MB72 and the bottom field MB73 are not in the relationship of the adjacent MB to each other, but the upper frame MB74 is in the relationship of the upper adjacent MB to the lower frame MB75. For this reason, when frame coding is selected, there is a restriction that the PMV of the lower frame MB75 must be determined in consideration of the intra / inter determination result of the upper frame MB74. In addition, since intra-prediction of the lower frame MB75 uses the reconstructed pixel of the upper frame MB74, if the motion compensation is performed for the upper frame MB74 and the reconstructed pixel is not created, the intra-prediction cannot be performed for the lower frame MB75. There is.

現MBペアと左隣接MBペアの両方ともフィールド符号化またはフレーム符号化が選択されている場合、現MBペアに含まれる各々のMBの左隣接MBはその左隣りに位置するMBのみである。しかし、現MBペアと左隣接MBペアのフィールド符号化/フレーム符号化の選択が異なる場合、左隣接MBペアに含まれる両方のMBが現MBペアに含まれる個々のMBの左隣接MBとなる。現MBペアはフィールド符号化が選択され、左隣接MBペアはフレーム符号化が選択された場合を図38(a)に示す。トップフィールドMB72の左隣接MBには左隣接MBペアに含まれる上フレームMBの奇数ライン76と下フレームMBの奇数ライン77が対応し、ボトムフィールドMB73の左隣接MBには、上フレームMBの偶数ラインと下フレームMBの偶数ラインが対応する。また、現MBペアはフレーム符号化が選択され、左隣接MBペアはフィールド符号化が選択された場合を図38(b)に示す。上フレームMB74の左隣接MBにはトップフィールドMBの上半分16ライン78とボトムフィールドMBの上半分16ライン79が対応し、下フレームMB75の左隣接MBにはトップフィールドMBの下半分16ラインとボトムフィールドMBの下半分16ラインが対応する。このため、左隣接MBペアに含まれる両方のMBについて動き補償が行われ、再生画素が算出されなければ、現MBペアについてイントラ予測を行うことができないという制限がある。   When field coding or frame coding is selected for both the current MB pair and the left adjacent MB pair, the left adjacent MB of each MB included in the current MB pair is only the MB located on the left side. However, when the field encoding / frame encoding selection of the current MB pair and the left adjacent MB pair is different, both MBs included in the left adjacent MB pair are left adjacent MBs of individual MBs included in the current MB pair. . FIG. 38A shows a case where field encoding is selected for the current MB pair and frame encoding is selected for the left adjacent MB pair. The odd line 76 of the upper frame MB and the odd line 77 of the lower frame MB included in the left adjacent MB pair correspond to the left adjacent MB of the top field MB72, and the even number of the upper frame MB corresponds to the left adjacent MB of the bottom field MB73. A line corresponds to an even line of the lower frame MB. Further, FIG. 38B shows a case where frame coding is selected for the current MB pair and field coding is selected for the left adjacent MB pair. The upper half 16 lines 78 of the top field MB and the upper half 16 lines 79 of the bottom field MB correspond to the left adjacent MB of the upper frame MB74, and the lower half 16 lines of the top field MB correspond to the left adjacent MB of the lower frame MB75. The lower half 16 lines of the bottom field MB correspond. For this reason, if motion compensation is performed for both MBs included in the left adjacent MB pair and the reproduced pixel is not calculated, intra prediction cannot be performed for the current MB pair.

本実施形態では、MBAFFの場合に、縦に連続する8のMB行をひとまとまりとして、これらひとまとまりのMB行から、縦に連続する2つのMB行当たり1つのMBペアを選択し、これら選択された4個のMBペアを1個のMBパイプラインに投入する例を示す。図39は、MBパイプラインに投入されるMBペアの例を示した説明図である。ピクチャは図7のものと同一であるが、上述した通りMBAFFではMBペアがフィールド符号化されるかフレーム符号化されるかにより、2つのMBへのラインの割り当てが異なる。そこで、英字の大文字を用いてMBペアを構成するMBを示す。フィールド符号化のときは、I15、K13、M11、O9等はトップフィールドMB72であり、J15、L13、N11、P9等はボトムフィールドMB73である。また、フレーム符号化のときは、I15、K13、M11、O9等は上フレームMB74であり、J15、L13、N11、P9等は下フレームMB75である。 In the present embodiment , in the case of MBAFF, eight MB rows that are vertically continuous are taken as a group, and one MB pair is selected from these batch of MB rows for every two MB rows that are vertically continuous. An example will be shown in which the four MB pairs are input to one MB pipeline. FIG. 39 is an explanatory diagram showing an example of MB pairs to be input to the MB pipeline. The picture is the same as that shown in FIG. 7, but as described above, in MBAFF, line assignment to two MBs differs depending on whether the MB pair is field-coded or frame-coded. Therefore, an MB that constitutes an MB pair is shown using uppercase letters. In the field coding, I15, K13, M11, O9, etc. are the top field MB72, and J15, L13, N11, P9, etc. are the bottom field MB73. In frame encoding, I15, K13, M11, O9, etc. are the upper frame MB74, and J15, L13, N11, P9, etc. are the lower frame MB75.

図40は、第13の実施形態に係る動画像符号化装置のブロック図である。MBペア選択回路81は、例えば、図39に示すようにi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとし、i−MB行とj−MB行に属するMBペアについては、左下隣接MBペアがまだ選択されていないMBペアを選択し、かつ、k−MB行とl−MB行、m−MB行とn−MB行、o−MB行とp−MB行に属するMBペアについては、右上隣接MBペアが既に選択されているMBペアを選択することによって、I15−J15、K13−L13、M11−N11、O9−P9のMBペアを選択する。フィールドMBペア/フレームMBペア構成回路82は、フィールド符号化が選択されたときは、MBペアの奇数ラインでトップフィールドMB72を構成し、MBペアの偶数ラインでボトムフィールドMB73を構成する。一方、フレーム符号化が選択されたときは、MBペアの上半分のラインで上フレームMB74を構成し、MBペアの下半分のラインで下フレームMB75を構成する。符号化データ設定回路83は、フィールド符号化が選択されたとき、最初に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。そして、2回目にI15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる残りの片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。また、フレーム符号化が選択されたとき、I15MB、K13MB、M11MB、O9MB、J15MB、L13MB、N11MB、P9MBの順番で、1マクロブロックサイクルごとに個々のMBを符号化するために必要なデータをMBパイプライン80に設定する。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。MBペア選択回路81によって選択された最後のMBを符号化するために必要なデータがMBパイプライン80に設定され、そのMBがMBパイプライン80に投入されると、MBペア選択回路81は、I16−J16、K14−L14、M12−N12、O10−P10のMBペアを新たに選択する。 FIG. 40 is a block diagram of a video encoding apparatus according to the thirteenth embodiment. For example, as shown in FIG. 39, the MB pair selection circuit 81 includes an i-MB row, a j-MB row, a k-MB row, an l-MB row, an m-MB row, an n-MB row, an o-MB row, For the MB pairs belonging to the p-MB rows and belonging to the i-MB rows and j-MB rows, the MB pairs for which the lower left neighboring MB pair has not yet been selected are selected, and the k-MB rows and the l- For MB pairs belonging to the MB row, the m-MB row and the n-MB row, the o-MB row and the p-MB row, by selecting the MB pair in which the upper right adjacent MB pair has already been selected, I15-J15 , K13-L13, M11-N11, O9-P9 MB pairs are selected. When field encoding is selected, the field MB pair / frame MB pair configuration circuit 82 configures the top field MB72 with the odd lines of the MB pair and configures the bottom field MB73 with the even lines of the MB pair. On the other hand, when frame encoding is selected, the upper frame MB74 is configured by the upper half line of the MB pair, and the lower frame MB75 is configured by the lower half line of the MB pair. When field encoding is selected, the encoded data setting circuit 83 first takes 4 MB cycles for one of the MBs included in the MB pairs of I15-J15, K13-L13, M11-N11, and O9-P9. In order, data necessary for encoding individual MBs every 1 MB cycle is set in the MB pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. Secondly, for each remaining MB included in the MB pair of I15-J15, K13-L13, M11-N11, and O9-P9, individual MBs are encoded every 1 MB cycle in order over 4 MB cycles. Data necessary for this is set in the MB pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When frame encoding is selected, the data necessary for encoding each MB in each macroblock cycle in the order of I15MB, K13MB, M11MB, O9MB, J15MB, L13MB, N11MB, and P9MB Set to pipeline 80. When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When data necessary for encoding the last MB selected by the MB pair selection circuit 81 is set in the MB pipeline 80, and the MB is input to the MB pipeline 80, the MB pair selection circuit 81 The MB pair of I16-J16, K14-L14, M12-N12, and O10-P10 is newly selected.

図41は、第13の実施形態に係る動画像符号化方法の処理のフローチャートを示す図である。例えば、図39に示すようにi−MB行、j−MB行、k−MB行、l−MB行、m−MB行、n−MB行、o−MB行、p−MB行をひとまとまりとし、i−MB行とj−MB行に属するMBペアについては、左下隣接MBペアがまだ選択されていないMBペアを選択し、かつ、k−MB行とl−MB行、m−MB行とn−MB行、o−MB行とp−MB行に属するMBペアについては、右上隣接MBペアが既に選択されているMBペアを選択することによって、I15−J15、K13−L13、M11−N11、O9−P9のMBペアが選択される(ステップS14)。次に、フィールド符号化が選択されたときは、MBペアの奇数ラインでトップフィールドMB72が構成され、MBペアの偶数ラインでボトムフィールドMB73が構成される。一方、フレーム符号化が選択されたときは、MBペアの上半分のラインで上フレームMB74が構成され、MBペアの下半分のラインで下フレームMB75が構成される(ステップS15、ステップS16、ステップS23)。そして、フィールド符号化が選択されたとき、最初に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS17、ステップS18、ステップS19)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。次に、I15−J15、K13−L13、M11−N11、O9−P9のMBペアに含まれる残りの片方のMBについて、4MBサイクルかけて順番に、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS20、ステップS21、ステップS22)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。また、フレーム符号化が選択されたとき、I15MB、K13MB、M11MB、O9MB、J15MB、L13MB、N11MB、P9MBの順番で、1MBサイクルごとに個々のMBを符号化するために必要なデータがMBパイプライン80に設定される(ステップS24、ステップS25、ステップS26、ステップS27、ステップS28、ステップS29)。MBを符号化するために必要なデータがMBパイプライン80に設定されると、そのMBはMBパイプライン80に投入される。選択された最後のMBを符号化するために必要なデータがMBパイプライン80に設定され、そのMBがMBパイプライン80に投入されると、ステップS14に戻り(ステップS21、ステップS28)、I16−J16、K14−L14、M12−N12、O10−P10のMBペアが新たに選択される(ステップS14)。 FIG. 41 is a diagram illustrating a flowchart of the process of the moving image coding method according to the thirteenth embodiment. For example, as shown in FIG. 39, i-MB line, j-MB line, k-MB line, l-MB line, m-MB line, n-MB line, o-MB line, and p-MB line are grouped. For the MB pairs belonging to the i-MB row and the j-MB row, the MB pair for which the lower left adjacent MB pair has not yet been selected is selected, and the k-MB row, the l-MB row, and the m-MB row For the MB pairs belonging to the n-MB row, the o-MB row, and the p-MB row, by selecting the MB pair for which the upper right adjacent MB pair has already been selected, I15-J15, K13-L13, M11- The MB pair of N11 and O9-P9 is selected (step S14). Next, when field coding is selected, the top field MB72 is composed of the odd lines of the MB pair, and the bottom field MB73 is composed of the even lines of the MB pair. On the other hand, when frame coding is selected, the upper frame MB74 is configured by the upper half line of the MB pair, and the lower frame MB75 is configured by the lower half line of the MB pair (steps S15, S16, and step S16). S23). When field coding is selected, first, one MB included in the MB pairs of I15-J15, K13-L13, M11-N11, and O9-P9 is sequentially repeated every 4 MB cycles for every 1 MB cycle. Data necessary for encoding individual MBs is set in the MB pipeline 80 (step S17, step S18, step S19). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. Next, in order to encode each MB for every 1 MB cycle in order over the remaining one MB included in the MB pairs of I15-J15, K13-L13, M11-N11, and O9-P9 over 4 MB cycles. Necessary data is set in the MB pipeline 80 (step S20, step S21, step S22). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When frame encoding is selected, the data necessary for encoding individual MBs every 1 MB cycle in the order of I15MB, K13MB, M11MB, O9MB, J15MB, L13MB, N11MB, and P9MB is stored in the MB pipeline. 80 (step S24, step S25, step S26, step S27, step S28, step S29). When data necessary for encoding an MB is set in the MB pipeline 80, the MB is input into the MB pipeline 80. When data necessary for encoding the selected last MB is set in the MB pipeline 80, and the MB is input to the MB pipeline 80, the process returns to step S14 (steps S21 and S28), and I16. -MB pairs of J16, K14-L14, M12-N12, and O10-P10 are newly selected (step S14).

図42は、8×8SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアがMBパイプラインの各ステージを流れていく様子を示す。ここで、フィールド画像は縦方向の画素数がフレーム画像の半分であるため、縮小画像を作成するために縦方向について2画素の画素値を平均すると、フィールド画像とフレーム画像では異なる縮小画像となる。一方、縦単画素/横2画素精度の縮小画像では、フレームの縮小画像から奇数ラインを抜き出すとトップフィールドの縮小画像となり、フレームの縮小画像から偶数ラインを抜き出すとボトムフィールドの縮小画像となる。このため、本実施形態では、図42に示すように、ステージ0で縦単画素/横2画素精度の参照領域をメモリに設定し、ステージ1では縦単画素/横2画素精度で動き検出を行う。 FIG. 42 shows that when MB pairs included in 8 MB rows are input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB pair flows through each stage of the MB pipeline. Show how it goes. Here, since the number of pixels in the vertical direction of the field image is half that of the frame image, when the pixel values of two pixels in the vertical direction are averaged to create a reduced image, the reduced image differs between the field image and the frame image. . On the other hand, in a reduced image with vertical / vertical two-pixel accuracy, if an odd line is extracted from the reduced image of the frame, it becomes a reduced image of the top field, and if an even line is extracted from the reduced image of the frame, it becomes a reduced image of the bottom field. Therefore, in the present embodiment, as shown in FIG. 42, to set the reference region of the vertical single pixel / horizontal half-pixel precision in the memory in stages 0, the motion detection in the vertical Stage 1 single pixel / horizontal half-pixel precision Do.

また、本実施形態では、I15、K13、M11、O9等のMBペアの片方のMBが4つ連続してMBパイプラインに投入された後、J15、L13、N11、P9等のMBペアの残りの片方のMBが4つ連続して投入される。このように、MBペアの片方のMBが連続してMBパイプラインに投入されるため、その順番で動きベクトルの参照領域を更新すると、更新領域が不連続となる。そこで、ステージ0で縦単画素/横2画素精度メモリを設定するときは、図22に示すように、8つのMB行の更新領域をひとまとまりの矩形領域として設定する。 In this embodiment , after four MBs in one of the MB pairs such as I15, K13, M11, and O9 are continuously inserted into the MB pipeline, the remaining MB pairs such as J15, L13, N11, and P9 are left. 4 MBs are continuously inserted. Thus, since one MB of the MB pair is continuously input into the MB pipeline, when the motion vector reference area is updated in that order, the update area becomes discontinuous. Therefore, when setting the vertical single pixel / horizontal two-pixel accuracy memory at stage 0, as shown in FIG. 22, the update areas of eight MB rows are set as a group of rectangular areas.

また、フィールド符号化とフレーム符号化のいずれかを選択するには、フィールド符号化とフレーム符号化の各々についてイントラ予測とインター予測の両方を行い、予測誤差の小さい符号化モードと予測モードの組合せを選択することが望ましい。しかし、この方法は膨大な演算量を必要とする。一方、現MBペア内の画素のみで符号化モードを判定し、選択された方のみについてイントラ予測とインター予測を行う簡易的な選択法も考えられる。たとえば、32ライン全てについて隣接したライン間で差分絶対値和または差分自乗和を求め、また、1ラインごと、すなわち奇数ライン16本と偶数ライン16本の隣接ライン間で差分絶対値和または差分自乗和を求めて、32ライン全てについて求めた方が小さかったときはフレーム符号化、1ラインごとに求めた方が小さかったときはフィールド符号化とする等の方法である。最適な選択とはならない場合もあるが、演算量は少ない。本実施形態では、簡易的な選択法を用いることとし、ステージ0でフィールド/フレーム判定を行った後、選択された符号化モードについて、図42に示すようにステージ1〜4でインター予測を行い、また、それと並列してステージ3と4で4×4イントラ予測、16×16イントラ予測等を行う。 In addition, to select either field coding or frame coding, both intra prediction and inter prediction are performed for each of field coding and frame coding, and a combination of a coding mode and a prediction mode with a small prediction error. It is desirable to select. However, this method requires a huge amount of calculation. On the other hand, a simple selection method is also conceivable in which an encoding mode is determined only with pixels in the current MB pair, and intra prediction and inter prediction are performed only on the selected one. For example, for all 32 lines, the sum of absolute differences or sum of squares of differences is calculated between adjacent lines, and the sum of absolute differences or squares of differences is calculated for each line, that is, between adjacent lines of 16 odd lines and 16 even lines. When the sum is obtained and the value obtained for all 32 lines is smaller, frame coding is performed, and when the value obtained for each line is smaller, field coding is performed. Although it may not be an optimal selection, the amount of computation is small. In this embodiment , a simple selection method is used, and after performing field / frame determination in stage 0, inter prediction is performed in stages 1-4 as shown in FIG. 42 for the selected coding mode. In parallel with this, 4 × 4 intra prediction, 16 × 16 intra prediction, and the like are performed in stages 3 and 4.

本実施形態では、第2の実施形態〜第4の実施形態と同様に縦に連続した8のMB行をひとまとまりとして処理する。しかし、上記段落0122で指摘したように、フレーム符号化が選択された場合、上フレームMB74は下フレームMB75に対して上隣接MBの関係にある。また、上記段落0123で指摘したように、現MBペアと左隣接MBペアのフィールド符号化/フレーム符号化の選択が異なる場合、左隣接MBペアに含まれる両方のMBが現MBペアに含まれる個々のMBの左隣接MBとなる。このため、上フレームMB74の処理結果を3ステージ分しか下フレームMB75の処理にフィードバックできず、また、左隣接MBペアの処理結果を3ステージ分しか現MBペアの処理にフィードバックできず、縦に連続した4つのMB行をひとまとまりとして処理する第5の実施形態と同様の制限が生じる。 In the present embodiment , as in the second to fourth embodiments , eight MB rows that are vertically continuous are processed as a group. However, as pointed out in paragraph 0122 above, when frame coding is selected, the upper frame MB74 is in the relationship of the upper adjacent MB with respect to the lower frame MB75. Also, as pointed out in paragraph 0123 above, when the field encoding / frame encoding selection of the current MB pair is different from that of the left adjacent MB pair, both MBs included in the left adjacent MB pair are included in the current MB pair. It becomes the left adjacent MB of each MB. For this reason, the processing result of the upper frame MB74 can be fed back to the processing of the lower frame MB75 only for three stages, and the processing result of the left adjacent MB pair can be fed back to the processing of the current MB pair only by three stages. The same limitation as in the fifth embodiment in which four consecutive MB rows are processed as a group occurs.

具体的には、例えば、ステージ5でI15MBのイントラ・インター判定が終了したとき、同時にステージ1においてJ15MBの縦単画素/横2画素精度動き検出も終了する。このため上フレームMB74のイントラ・インター判定結果を下フレームMB75の縦単画素/横2画素精度動き検出に反映できないという制限がある。ただし、図42中に矢印で示すように、上フレームMB74のイントラ・インター判定結果はステージ2以降に反映できる。また、左隣接MBペア、上隣接MBペア、右上隣接MBペア等についてステージ5で確定したイントラ・インター判定結果はステージ1の縦単画素/横2画素精度動き検出に反映できる。そこで、ステージ1においては、左隣接MBペア、上隣接MBペア、右上隣接MBペア等の動きベクトルを参照して仮のPMVを作成し、下フレームMB75内の4つの8×8SB全てが共通にこの仮のPMVを参照して縦単画素/横2画素精度動き検出を行う。そして、ステージ2ではステージ1で検出された縦単画素/横2画素精度の候補動きベクトルの周辺領域を単画素精度メモリに設定し、ステージ3で真のPMVを作成し、ステージ3とステージ4で真のPMVを参照して単画素精度動き検出と1/4画素精度動き検出を行う。   Specifically, for example, when I15 MB intra / inter determination is completed in stage 5, J15MB vertical single pixel / horizontal two pixel accuracy motion detection is also ended in stage 1 at the same time. For this reason, there is a limitation that the intra / inter determination result of the upper frame MB74 cannot be reflected in the vertical single pixel / horizontal two-pixel accuracy motion detection of the lower frame MB75. However, as indicated by arrows in FIG. 42, the intra / inter determination result of the upper frame MB74 can be reflected in the stage 2 and subsequent stages. Also, the intra / inter determination results determined in stage 5 for the left adjacent MB pair, the upper adjacent MB pair, the upper right adjacent MB pair, and the like can be reflected in the vertical single pixel / horizontal two pixel accuracy motion detection in stage 1. Therefore, in stage 1, a temporary PMV is created with reference to motion vectors such as the left adjacent MB pair, the upper adjacent MB pair, and the upper right adjacent MB pair, and all four 8 × 8 SBs in the lower frame MB75 are shared. With reference to the provisional PMV, the vertical single pixel / horizontal two-pixel accuracy motion detection is performed. Then, in stage 2, the peripheral area of the candidate motion vector of vertical single pixel / horizontal two pixel precision detected in stage 1 is set in the single pixel precision memory, and a true PMV is created in stage 3, and stage 3 and stage 4 Then, single-pixel accuracy motion detection and quarter-pixel accuracy motion detection are performed with reference to the true PMV.

図43はステージ3と4におけるSBパイプラインの詳細な動作を示す。1つのMB内に含まれる4つの8×8SBについて0番から3番までシリアルに処理される。このため、単画素精度動き検出と1/4画素精度動き検出では隣接8×8SBの動きベクトルを考慮した真のPMVに基づいて動き検出を行うことができる。   FIG. 43 shows the detailed operation of the SB pipeline in stages 3 and 4. Four 8 × 8 SBs included in one MB are serially processed from No. 0 to No. 3. For this reason, in the single-pixel precision motion detection and the quarter-pixel precision motion detection, it is possible to perform motion detection based on a true PMV in consideration of the adjacent 8 × 8 SB motion vector.

ただし、本実施形態では、空間ダイレクトアドレスの評価が別途必要となる。ステージ1で仮のPMVに基づいて縦単画素/横2画素精度動き検出が行われ、ステージ2ではステージ1で検出された候補動きベクトルの周辺領域が単画素精度メモリに設定される。ステージ1の仮のPMVとステージ3の真のPMVが異なる場合、ステージ3と4で動き検出する領域に空間ダイレクトアドレスに対応する位置のMBや8×8SB等が含まれない場合がある。そこで、ステージ3およびステージ4と並列に空間ダイレクトアドレスに対応する位置のMBや8×8SBのコストを評価する処理を行う必要がある。 However, in the present embodiment, the evaluation of the spatial direct address required separately. In stage 1, vertical single pixel / horizontal 2 pixel precision motion detection is performed based on the provisional PMV, and in stage 2, the peripheral area of the candidate motion vector detected in stage 1 is set in the single pixel precision memory. When the temporary PMV of stage 1 and the true PMV of stage 3 are different, the area where motion is detected in stages 3 and 4 may not include the MB corresponding to the spatial direct address, 8 × 8 SB, or the like. Therefore, it is necessary to perform processing for evaluating the MB of the position corresponding to the spatial direct address and the cost of 8 × 8 SB in parallel with stage 3 and stage 4.

4×4イントラ予測のために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、個々のMBペアがMBパイプラインの各ステージを流れていく様子を図44に示す。また、図45はステージ3と4におけるSBパイプラインの詳細な動作を示す。ここで、上記段落0122と段落0123で指摘した条件を満たすために、第5の実施形態と同様に動き補償はステージ6で行われる。すなわち、上フレームMB74について動き補償が行われた後に下フレームMB75についてイントラ予測が行われ、かつ、左隣接MBペアに含まれる両方のMBについて動き補償が行われた後に現MBペアについてイントラ予測が行われるという条件を満たすために、動き補償はステージ6で行われる。 FIG. 44 shows how each MB pair flows through each stage of the MB pipeline when an MB pair included in 8 MB rows is inserted into one MB pipeline for 4 × 4 intra prediction. Show. FIG. 45 shows the detailed operation of the SB pipeline in stages 3 and 4. Here, in order to satisfy the conditions pointed out in the paragraphs 0122 and 0123, motion compensation is performed in the stage 6 as in the fifth embodiment . That is, intra prediction is performed for the lower frame MB75 after motion compensation is performed for the upper frame MB74, and intra prediction is performed for the current MB pair after motion compensation is performed for both MBs included in the left adjacent MB pair. In order to satisfy the condition that it is performed, motion compensation is performed at stage 6.

また、ステージ7の可変長符号化による発生符号量の変動を調整するため、量子化パラメータを変更するというレート制御をステージ8で行う必要が生じる場合がある。この場合、第5の実施形態と同様に、ステージ5のイントラ・インター判定において4×4イントラ予測モードを選択しないようにするか、または4×4イントラ予測モードが選択されたときはステージ6で新しい量子化パラメータを用いて整数変換・量子化・逆量子化・逆整数変換をやり直す必要がある。 In addition, in order to adjust fluctuations in the generated code amount due to variable length coding in stage 7, it may be necessary to perform rate control in stage 8 to change the quantization parameter. In this case, as in the fifth embodiment , the 4 × 4 intra prediction mode is not selected in the intra / inter determination of stage 5 or when the 4 × 4 intra prediction mode is selected, in stage 6 It is necessary to redo integer transformation, quantization, inverse quantization, and inverse integer transformation using new quantization parameters.

なお、本実施形態で示したMBパイプラインのステージ構成は一例であって、他のステージ構成とすることも可能である。そして、ステージ構成が変われば、ひとまとまりとして符号化する縦に連続する複数のMB行の数が同じであっても、動き検出やイントラ予測等における制約は変わる。 Incidentally, the stage construction of the MB pipeline shown in this embodiment is an example, it is also possible to other stage arrangement. If the stage configuration is changed, the constraints in motion detection, intra prediction, and the like change even if the number of vertically continuous MB rows encoded as a group is the same.

また、本実施形態に記載された発明と第6の実施形態〜第12の実施形態に記載された発明を同時に動画像符号化装置に適用することも可能である。 It is also possible to apply simultaneously the video encoding apparatus of the invention described in has been the invention of the sixth to twelfth embodiments of the described embodiment.

MBパイプラインに連続して投入されるMBの例を示した説明図である。It is explanatory drawing which showed the example of MB thrown continuously into MB pipeline. 本発明が適用される動画像符号化装置のブロック図である。It is a block diagram of the moving image encoder to which the present invention is applied. 本発明が適用される動画像符号化方法の処理のフローチャートである。It is a flowchart of a process of the moving image encoding method to which this invention is applied. 図1に例示される4個のMBを1個のMBパイプラインに連続して投入したときに、各MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。FIG. 2 is an explanatory diagram showing a state in which each MB flows through each stage of the MB pipeline when the four MBs exemplified in FIG. 1 are continuously input into one MB pipeline. 図1のピクチャを構成する各MBがMBパイプラインに投入され、ステージ0の処理が開始されるMBサイクル番号を示した説明図である。FIG. 2 is an explanatory diagram showing MB cycle numbers at which the MBs constituting the picture of FIG. 1 are input to the MB pipeline and stage 0 processing is started. 8画素×8画素の4つのSBに分割されたMBを示した説明図である。It is explanatory drawing which showed MB divided | segmented into 4 SB of 8 pixels x 8 pixels. MBパイプラインに連続して投入されるMBの例を示した説明図である。It is explanatory drawing which showed the example of MB thrown continuously into MB pipeline. 8画素×8画素SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。In order to detect a motion vector for every 8 pixels × 8 pixels SB, when MBs included in 8 MB rows are continuously input to one MB pipeline, each MB flows through each stage. It is explanatory drawing shown. 本発明が適用される動きベクトル検出回路のブロック図である。It is a block diagram of a motion vector detection circuit to which the present invention is applied. 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. 本発明が適用される動きベクトル検出回路のブロック図である。It is a block diagram of a motion vector detection circuit to which the present invention is applied. 16個の4画素×4画素SBに分割されたMBを示した説明図である。It is explanatory drawing which showed MB divided | segmented into 16 4 pixels x 4 pixels SB. 4画素×4画素イントラ予測のために、8つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。An explanatory diagram showing how each MB flows through each stage when MBs included in 8 MB rows are continuously input to one MB pipeline for 4 pixel × 4 pixel intra prediction. is there. 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. 8×8SBごとの動きベクトルを検出するために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。When MBs included in four MB rows are continuously input to one MB pipeline in order to detect a motion vector for each 8 × 8 SB, each MB flows through each stage of the MB pipeline. It is explanatory drawing which showed. 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. 4画素×4画素イントラ予測のために、4つのMB行に含まれるMBを1個のMBパイプラインに連続して投入したとき、各MBが各ステージを流れていく様子を示した説明図である。An explanatory diagram showing how each MB flows through each stage when MBs included in four MB rows are continuously input to one MB pipeline for 4 pixel × 4 pixel intra prediction. is there. 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. 内部メモリを有する動画像符号化装置のブロック図である。It is a block diagram of the moving image encoder which has an internal memory. 縦に連続する4つのMB行に含まれる4個のMBを1個のMBパイプラインで処理する場合の参照領域を示した説明図である。It is explanatory drawing which showed the reference area | region in the case of processing 4 MB contained in 4 vertical MB lines by one MB pipeline. 参照領域用メモリに参照領域を記憶するもう一つの方法を示した説明図である。It is explanatory drawing which showed another method which memorize | stores a reference area in the memory for reference areas. 広い範囲で動きを検出できる動き検出装置と、本発明が適用されたMBパイプラインを含む動画像符号化装置の組み合わせを示した説明図である。It is explanatory drawing which showed the combination of the motion detection apparatus which can detect a motion in a wide range, and the moving image encoding apparatus containing MB pipeline to which this invention was applied. 2つの動画像符号化装置と内部メモリを有する並列動画像符号化装置のブロック図である。It is a block diagram of a parallel moving image encoding device having two moving image encoding devices and an internal memory. 2つの動画像符号化装置が分担するピクチャの領域を示した説明図である。It is explanatory drawing which showed the area | region of the picture which two moving image encoders share. 2つの動画像符号化装置に含まれるMBパイプラインの各ステージをMBが流れていく様子を示した説明図である。It is explanatory drawing which showed a mode that MB flows through each stage of MB pipeline contained in two moving image encoders. 推定発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。It is a block diagram of a CABAC encoder that performs rate control based on an estimated generated code amount. コンテクスト情報復元回路の処理フローを示す図である。It is a figure which shows the processing flow of a context information restoration circuit. 仮の発生符号量に基づいてレート制御を行うCABAC符号化器のブロック図である。It is a block diagram of a CABAC encoder that performs rate control based on a provisional generated code amount. 縦に連続する4つのMB行をひとまとまりとして符号化を行う場合の仮算術符号化回路のブロック図である。It is a block diagram of a provisional arithmetic encoding circuit when encoding is performed with a group of four vertically continuous MB rows. 仮算術符号化回路においてMB行内の先頭のMBについて仮のrange、low、および確率テーブルを設定する方法の一つを説明する図である。It is a figure explaining one of the methods of setting a temporary range, low, and a probability table about the head MB in MB row in a temporary arithmetic coding circuit. 2並列で仮算術符号化を行う場合の仮算術符号化回路のブロック図である。It is a block diagram of a provisional arithmetic coding circuit when performing provisional arithmetic coding in two parallel. 2並列で仮算術符号化を行う場合にMBがMBパイプラインの各ステージを流れていく様子を示した説明図である。It is explanatory drawing which showed a mode that MB flows through each stage of MB pipeline, when provisional arithmetic coding is performed in 2 parallel. CAVLCで圧縮する場合のCABAC符号化器のブロック図である。It is a block diagram of the CABAC encoder in the case of compressing by CAVLC. 2つの動画像符号化装置で構成される並列動画像符号化装置から2値化シンボルを出力し、CABACで符号化された1本のビットストリームを生成する並列動画像符号化装置のブロック図である。FIG. 2 is a block diagram of a parallel moving image encoding device that outputs a binary symbol from a parallel moving image encoding device configured by two moving image encoding devices and generates one bit stream encoded by CABAC. is there. 2つの動画像符号化装置で構成される並列動画像符号化装置からCAVLC符号化ビットストリームを出力し、CABACで符号化された1本のビットストリームを生成する並列動画像符号化装置のブロック図である。Block diagram of a parallel video encoding device that outputs a CAVLC encoded bitstream from a parallel video encoding device composed of two video encoding devices and generates one bitstream encoded by CABAC It is. フィールド符号化が選択されたときのMBペアとフレーム符号化が選択されたときのMBペアを示した説明図である。It is explanatory drawing which showed MB pair when a frame encoding is selected, and MB pair when field encoding is selected. 現MBペアはフィールド符号化が選択され、左隣接MBペアはフレーム符号化が選択された場合の左隣接MBペアと、現MBペアはフレーム符号化が選択され、左隣接MBペアはフィールド符号化が選択された場合の左隣接MBペアを示した説明図である。Field coding is selected for the current MB pair, frame coding is selected for the left adjacent MB pair when the frame coding is selected for the left adjacent MB pair, frame coding is selected for the current MB pair, and field coding is performed for the left adjacent MB pair It is explanatory drawing which showed the left adjacent MB pair when is selected. MBパイプラインに投入されるMBペアの例を示した説明図である。It is explanatory drawing which showed the example of the MB pair thrown into MB pipeline. 第13の実施形態に係る動画像符号化装置のブロック図である It is a block diagram of the moving image encoder which concerns on 13th Embodiment . 第13の実施形態に係る動画像符号化方法の処理のフローチャートを示す図である。It is a figure which shows the flowchart of a process of the moving image encoding method which concerns on 13th Embodiment. 8画素×8画素SBごとの動きベクトルを検出するために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアが各ステージを流れていく様子を示した説明図である。In order to detect a motion vector for every 8 pixels × 8 pixels SB, when MB pairs included in 8 MB rows are input to one MB pipeline, each MB pair flows through each stage. FIG. 8画素×8画素SBごとの動きベクトルを検出するためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for detecting the motion vector for every 8 pixel x 8 pixel SB. 4画素×4画素イントラ予測のために、8つのMB行に含まれるMBペアを1個のMBパイプラインに投入したとき、各MBペアがMBパイプラインの各ステージを流れていく様子を示した説明図である。When MB pairs included in 8 MB rows are input to one MB pipeline for 4 pixel × 4 pixel intra prediction, each MB pair flows through each stage of the MB pipeline. It is explanatory drawing. 4画素×4画素イントラ予測のためのSBパイプラインの詳細な動作を示した説明図である。It is explanatory drawing which showed the detailed operation | movement of SB pipeline for 4 pixel x 4 pixel intra prediction. MPEG−2の符号化器のブロック図である。It is a block diagram of an MPEG-2 encoder. H.264の符号化器のブロック図である。H. 2 is a block diagram of an H.264 encoder. FIG. 従来のH.264の符号化器のMBパイプラインにおいて、MBがMBパイプラインの各ステージを流れていく様子を示した説明図である。Conventional H.264. 2 is an explanatory diagram showing a state in which an MB flows through each stage of the MB pipeline in an MB pipeline of an H.264 encoder. FIG. 従来の動画像符号化装置の構成を示したブロック図である。It is the block diagram which showed the structure of the conventional moving image encoder . 隣接する2つのMBの参照領域の例を示した説明図である。It is explanatory drawing which showed the example of the reference area of two adjacent MB. ピクチャ分割方法を示した説明図である。It is explanatory drawing which showed the picture division | segmentation method. CABAC符号化器のブロック図である。It is a block diagram of a CABAC encoder. 算術符号化回路の処理内容を表すBiari_encode_symbol処理フローである。It is a Biari_encode_symbol processing flow showing the processing contents of the arithmetic encoding circuit. symbolがLPSであるときのrangeとlowの変化と、symbolがMPSであるときのrangeとlowの変化を示した説明図である。It is explanatory drawing which showed the change of range and low when symbol is LPS, and the change of range and low when symbol is MPS.

符号の説明Explanation of symbols

1、80…MBパイプライン、2…MB選択回路、3、83…符号化データ設定回路、14…参照領域用メモリ、15…バッファメモリ、20…可変長符号化部、23、40、41…動画像符号化装置、24、25、26、27…MB、28、29、30、31、36…参照領域、32、33、34、35、37…更新領域、28、29、30、34を全て含む矩形の領域、39…内部メモリ、42…並列動画像符号化装置、43…2値化回路、44…発生符号量推定回路、45…2値化シンボル記憶回路、46…算術符号化回路、47…コンテクスト情報復元回路、48…仮算術符号化回路、68…2並列で仮算術符号化を行う仮算術符号化回路、69…CAVLC符号化回路、70…CAVLC符号化ビットストリーム記憶回路、71…CAVLC復号回路、72…トップフィールドMB、73…ボトムフィールドMB、74…上フレームMB、75…下フレームMB、76…上フレームMB奇数ライン、77…下フレームMB奇数ライン、78…トップフィールドMB上半分16ライン、79…ボトムフィールドMB上半分16ライン、81…MBペア選択回路、82…フィールドMBペア/フレームMBペア構成回路   DESCRIPTION OF SYMBOLS 1,80 ... MB pipeline, 2 ... MB selection circuit, 3, 83 ... Encoded data setting circuit, 14 ... Memory for reference area, 15 ... Buffer memory, 20 ... Variable length encoding part, 23, 40, 41 ... Moving picture encoding device, 24, 25, 26, 27 ... MB, 28, 29, 30, 31, 36 ... Reference area, 32, 33, 34, 35, 37 ... Update area, 28, 29, 30, 34 Rectangular area including all, 39 ... internal memory, 42 ... parallel video encoding device, 43 ... binarization circuit, 44 ... generated code amount estimation circuit, 45 ... binary symbol storage circuit, 46 ... arithmetic encoding circuit 47 ... Context information restoration circuit, 48 ... Temporary arithmetic coding circuit, 68 ... Temporary arithmetic coding circuit for performing provisional arithmetic coding in parallel, 69 ... CAVLC coding circuit, 70 ... CAVLC coded bitstream storage circuit, 71 ... AVLC decoding circuit, 72 ... top field MB, 73 ... bottom field MB, 74 ... upper frame MB, 75 ... lower frame MB, 76 ... upper frame MB odd line, 77 ... lower frame MB odd line, 78 ... top field MB Half 16 lines, 79 ... Bottom field MB Upper half 16 lines, 81 ... MB pair selection circuit, 82 ... Field MB pair / Frame MB pair configuration circuit

本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を、縦方向に連続するm行(mは2以上の整数)ずつひとまとまりとして符号化を行い、個々のマクロブロック行の中では、左端のマクロブロックから符号化を開始し、右に隣接したマクロブロックを順番に符号化する動画像符号化装置であって、動画像符号化の処理を複数のステージに分割し、個々のマクロブロックをステージごとに1マクロブロックサイクルかけて処理し、1マクロブロックサイクルごとに1個のマクロブロックの符号化を終了するマクロブロックパイプラインを有し、mマクロブロックサイクルごとに、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始し、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで、各マクロブロック行に含まれるマクロブロックが順番に、上に隣接したマクロブロック行に含まれるマクロブロックが前記マクロブロックパイプラインに投入されてから1マクロブロックサイクル後に前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始する。 The moving picture coding apparatus according to the present invention includes m rows (m is an integer equal to or greater than 2) that are macroblock rows that are a collection of macroblocks arranged in a row in the horizontal direction from the left end to the right end of a picture. It is a moving picture encoding apparatus that performs encoding as a unit, and in each macroblock row, starts encoding from the leftmost macroblock and sequentially encodes macroblocks adjacent to the right, A macroblock that divides the video encoding process into a plurality of stages, processes each macroblock by one macroblock cycle for each stage, and finishes encoding one macroblock every macroblock cycle It has a pipeline and is included in the top macroblock row of the group of macroblock rows every m macroblock cycles. A macroblock is input to the macroblock pipeline, the macroblock pipeline starts encoding the macroblock, and the lowest macroblock line from the top of the group of macroblock lines is the lowest. The macroblocks included in each macroblock row up to a macroblock row of the macroblock in order, and the macroblocks included in the macroblock row adjacent above the macroblock pipeline are inserted into the macroblock pipeline one macroblock cycle later. The macroblock pipeline starts to encode the macroblock.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行までのマクロブロック行に含まれる前記マクロブロックは、当該マクロブロックが前記マクロブロックパイプラインに含まれる第1のステージにおいて処理されるとき、当該マクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入されたマクロブロックを除き、上に隣接したマクロブロック行に含まれるマクロブロックが当該第1のステージより後に実行される第2のステージにおいて処理された結果を用いて処理されることができる。 Preferably , in the moving picture encoding apparatus according to the present invention, the macroblock included in a macroblock row from a second macroblock row to a lowermost macroblock row in the group of macroblock rows. When the macroblock is processed in the first stage included in the macroblock pipeline, the macroblock is input to the macroblock pipeline one macroblock cycle before the macroblock is input to the macroblock pipeline. Except for the processed macroblock, the macroblock included in the macroblock row adjacent above can be processed using the result processed in the second stage executed after the first stage.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行までのマクロブロック行において、前記マクロブロックパイプラインに投入されるマクロブロックは、当該マクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入されたマクロブロックより左に位置し、当該マクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入されたマクロブロックが右上隣接マクロブロックではないマクロブロックである。 Preferably , the moving picture encoding apparatus according to the present invention is configured such that the macroblock pipe in the macroblock row from the second macroblock row to the lowest macroblock row in the group of macroblock rows. The macroblock that is input to the line is located to the left of the macroblock that is input to the macroblock pipeline one macroblock cycle before the macroblock is input to the macroblock pipeline. The macroblock input to the macroblock pipeline one macroblock cycle input to the macroblock pipeline is a macroblock that is not the upper right adjacent macroblock.

また、本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を、縦方向に連続する2n行(nは2以上の整数)ずつひとまとまりとし、縦方向に隣接する2個のマクロブロックを組み合わせてマクロブロックペアを作成してマクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化を行い、縦方向に隣接する2行のマクロブロック行の中では、左端のマクロブロックペアから符号化を開始し、右に隣接したマクロブロックペアを順番に符号化する動画像符号化装置であって、動画像符号化の処理を複数のステージに分割し、個々のマクロブロックをステージごとに1マクロブロックサイクルかけて処理し、1マクロブロックサイクルごとに1個のマクロブロックの符号化を終了するマクロブロックパイプラインを有し、2nマクロブロックサイクルごとに、前記ひとまとまりのマクロブロック行の中の最も上に位置する2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始し、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで、縦方向に隣接する2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが順番に、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入されてから1マクロブロックサイクル後に前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該片方のマクロブロックの符号化を開始し、前記ひとまとまりのマクロブロック行の中の前記最も下に位置する2行のマクロブロック行に属するマクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに投入されてから1マクロブロックサイクル後に、前記ひとまとまりのマクロブロック行の中の前記最も上に位置する2行のマクロブロック行に属する前記マクロブロックペアに含まれるマクロブロックであって、まだ前記マクロブロックパイプラインに投入されていない他の片方のマクロブロックが前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始し、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行まで、縦方向に隣接する2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックであって、まだ前記マクロブロックパイプラインに投入されていない他の片方のマクロブロックが順番に、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれる他の片方のマクロブロックが前記マクロブロックパイプラインに投入されてから1マクロブロックサイクル後に前記マクロブロックパイプラインに投入され、前記マクロブロックパイプラインが当該他の片方のマクロブロックの符号化を開始する。 Also, the moving picture encoding apparatus of the present invention converts a macro block row, which is a collection of macro blocks arranged in a row in the horizontal direction from the left end to the right end of a picture, into 2n rows (n is 2 or more). (Integer) are grouped together and a macroblock pair is created by combining two adjacent macroblocks in the vertical direction, and encoding is performed by switching between field encoding and frame encoding for each macroblock pair. A moving picture coding apparatus which starts coding from a leftmost macro block pair and sequentially codes right adjacent macro block pairs in two adjacent macro block lines, Is divided into a plurality of stages, and each macroblock is processed over one macroblock cycle for each stage, and every macroblock cycle is processed. A macroblock pipeline that finishes encoding one macroblock, and a macro that belongs to the two highest macroblock rows in the group of macroblock rows every 2n macroblock cycles One macroblock included in the block pair is input to the macroblock pipeline, the macroblock pipeline starts encoding the one macroblock, and the top three in the group of macroblock rows From the first and fourth macroblock rows to the two lowermost macroblock rows, one macroblock included in the macroblock pair belonging to the two macroblock rows adjacent in the vertical direction is sequentially , One of the macroblock pairs belonging to the two adjacent macroblock rows A macro block is inserted into the macro block pipeline one macro block cycle after the macro block is input into the macro block pipeline, the macro block pipeline starts encoding the one macro block, and the group of macro blocks One macroblock included in the macroblock pair belonging to the two lowest macroblock rows in the block row is input to the macroblock pipeline, and after one macroblock cycle, The other macroblock that is included in the macroblock pair belonging to the two topmost macroblock rows in the macroblock row and has not yet been put into the macroblock pipeline Is the macroblock pie The macroblock pipeline starts encoding the other macroblock, and the third and fourth macroblock rows from the top of the group of macroblock rows Other macroblocks included in a macroblock pair belonging to two macroblock rows adjacent in the vertical direction up to two macroblock rows positioned below and not yet put into the macroblock pipeline After one macroblock cycle, the other macroblock included in the macroblock pair belonging to the two macroblock rows adjacent to each other in order is put into the macroblock pipeline one macroblock cycle later. To the block pipeline, and the macroblock pipeline is connected to the other To start the encoding of black block.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行までの縦方向に隣接する2行のマクロブロック行に属する前記マクロブロックペアに含まれる片方のマクロブロックは、当該マクロブロックペアに含まれる片方のマクロブロックが前記マクロブロックパイプラインに含まれる第1のステージにおいて処理されるとき、当該片方のマクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入された片方のマクロブロックが含まれるマクロブロックペアを除き、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックが当該第1のステージより後に実行される第2のステージにおいて処理された結果を用いて処理されることができ、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行までの縦方向に隣接する2行のマクロブロック行に属する前記マクロブロックペアに含まれる他の片方のマクロブロックは、当該マクロブロックペアに含まれる他の片方のマクロブロックが前記マクロブロックパイプラインに含まれる第1のステージにおいて処理されるとき、当該他の片方のマクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入された他の片方のマクロブロックが含まれるマクロブロックペアを除き、上に隣接した2行のマクロブロック行に属するマクロブロックペアに含まれるマクロブロックが当該第1のステージより後に実行される第2のステージにおいて処理された結果を用いて処理されることができる。 Preferably, the moving picture coding apparatus according to the present invention includes a group of macroblock rows from the top to the third and fourth macroblock rows to the bottom two macroblock rows. One macroblock included in the macroblock pair belonging to two macroblock rows adjacent in the vertical direction is a first stage in which one macroblock included in the macroblock pair is included in the macroblock pipeline. Except for a macroblock pair that includes one macroblock that was input to the macroblock pipeline one macroblock cycle before the one macroblock was input to the macroblock pipeline. A macro block included in a macro block pair belonging to two macro block rows adjacent to Can be processed using the results processed in the second stage executed after the first stage, and the third and fourth rows from the top of the group of macroblock rows. The other macroblock included in the macroblock pair belonging to the two macroblock rows vertically adjacent from the first macroblock row to the two lowermost macroblock rows is the macroblock. When one other macroblock included in the pair is processed in the first stage included in the macroblock pipeline, one macroblock cycle in which the other macroblock is input to the macroblock pipeline A macro that contains another macroblock that was previously entered into the macroblock pipeline Except for the lock pair, the macroblocks included in the macroblock pairs belonging to the two adjacent macroblock rows are processed using the result processed in the second stage executed after the first stage. Can.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行の中の上から3行目と4行目のマクロブロック行から最も下に位置する2行のマクロブロック行において、前記マクロブロックパイプラインに投入される片方のマクロブロックと他の片方のマクロブロックが含まれるマクロブロックペアは、当該片方のマクロブロックまたは当該他の片方のマクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入されたマクロブロックが含まれるマクロブロックペアより左に位置し、当該片方のマクロブロックまたは当該他の片方のマクロブロックが前記マクロブロックパイプラインに投入される1マクロブロックサイクル前に前記マクロブロックパイプラインに投入されたマクロブロックが含まれるマクロブロックペアが右上隣接マクロブロックペアではないマクロブロックである。 Preferably, the moving picture encoding apparatus according to the present invention includes the macroblock rows located at the bottom of the third and fourth macroblock rows from the top of the group of macroblock rows, In a macroblock pair including one macroblock and one other macroblock that are input to the macroblock pipeline, the one macroblock or the other macroblock is input to the macroblock pipeline. One macroblock cycle before the macroblock pair including the macroblock input to the macroblock pipeline, the one macroblock or the other macroblock is placed in the macroblock pipeline. One macroblock cycle before the input macroblock Macroblock pair that contains the macroblock is input to the pipeline is a macro block is not at the top right neighboring macroblock pair.

好ましくは、本発明の動画像符号化装置は、ピクチャの最も上の前記ひとまとまりのマクロブロック行から符号化を開始し、下に隣接した前記ひとまとまりのマクロブロック行を順番に符号化する。 Preferably, the moving picture coding apparatus according to the present invention starts coding from the uppermost group of macroblock rows of a picture, and sequentially encodes the lowermost group of macroblock rows adjacent to each other.

また、本発明の動画像符号化装置は、動画像符号化の処理を複数のステージに分割し、個々のマクロブロックをステージごとに1マクロブロックサイクルかけて処理し、1マクロブロックサイクルごとに1個のマクロブロックの符号化を終了するマクロブロックパイプラインと、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を、縦方向に連続する少なくても2行ずつひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択するマクロブロック選択部と、前記マクロブロック選択部によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記マクロブロックパイプラインに設定する符号化データ設定部とを有し、前記符号化データ設定部によってマクロブロックを符号化するために必要な前記データが設定されると、前記マクロブロックパイプラインが当該マクロブロックの符号化を開始し、前記符号化データ設定部によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要な前記データが前記マクロブロックパイプラインに設定されると、前記マクロブロック選択部が前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択する。 Further , the moving picture coding apparatus of the present invention divides the moving picture coding process into a plurality of stages, processes each macro block for one macro block cycle for each stage, and 1 for each macro block cycle. A macroblock pipeline that finishes encoding one macroblock and a macroblock row that is a collection of macroblocks arranged in a row in the horizontal direction from the left end to the right end of the picture are at least 2 in the vertical direction. For each macroblock belonging to the uppermost macroblock row in the group of macroblock rows, a macroblock for which the lower left adjacent macroblock has not yet been selected is selected, and the batch is selected. For macroblocks belonging to macroblock lines other than the topmost A macroblock selection unit that selects one macroblock per macroblock row by selecting a macroblock in which the right upper adjacent macroblock has already been selected, and the macroblock For the individual macroblocks selected by the block selection unit, the macroblocks belonging to the uppermost macroblock row in the group of macroblock rows to the macroblocks belonging to the lowermost macroblock row are sequentially 1 An encoded data setting unit that sets data necessary for encoding individual macroblocks in each macroblock cycle in the macroblock pipeline, and encodes the macroblock by the encoded data setting unit. The data required for The macroblock pipeline starts encoding the macroblock, and the encoded data setting unit encodes a macroblock belonging to the lowest macroblock row in the group of macroblock rows. When the necessary data is set in the macroblock pipeline, the macroblock selection unit newly selects the right adjacent macroblock for each selected macroblock.

好ましくは、本発明の動画像符号化装置は、前記マクロブロックパイプラインが、マクロブロックが分割されたサブブロックごとの処理を行うサブブロックパイプラインを含む。 Preferably, in the moving image encoding apparatus of the present invention , the macroblock pipeline includes a subblock pipeline that performs processing for each subblock into which the macroblock is divided.

好ましくは、本発明の動画像符号化装置は、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを、各マクロブロック行当たり1個符号化するために必要な全てのデータを記憶する内部メモリを有する。 Preferably, the moving picture encoding apparatus of the present invention includes an internal memory for storing all data necessary for encoding one macroblock included in the group of macroblock rows, one for each macroblock row. Have.

好ましくは、本発明の動画像符号化装置は、請求項1から請求項10までのいずれか1項に記載の動画像符号化装置が少なくても2台含まれ、縦方向に連続した前記ひとまとまりのマクロブロック行が個々の前記動画像符号化装置に割り当てられ、当該縦方向に連続した前記ひとまとまりのマクロブロック行が並列に符号化される。 Preferably, the moving picture coding apparatus according to the present invention includes at least two moving picture coding apparatuses according to any one of claims 1 to 10 and is continuous in the vertical direction. A group of macroblock rows is allocated to each of the moving picture encoding devices, and the group of macroblock rows continuous in the vertical direction is encoded in parallel.

好ましくは、本発明の動画像符号化装置は、シンタックスデータを2値化シンボルに変換する2値化部と、前記2値化シンボルを記憶する2値化シンボル記憶部と、前記2値化シンボル記憶部から読み出した2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元部と、前記2値化シンボル記憶部から読み出した2値化シンボルを、前記コンテクスト情報復元部により復元されたコンテクスト情報に基づいて算術符号化する算術符号化部とを有する。Preferably, the moving picture coding apparatus according to the present invention includes a binarization unit that converts syntax data into a binarized symbol, a binarized symbol storage unit that stores the binarized symbol, and the binarization. A context information restoration unit that restores context information corresponding to the binarized symbol read from the symbol storage unit; and a context in which the binarized symbol read from the binarized symbol storage unit is restored by the context information restoration unit An arithmetic encoding unit that performs arithmetic encoding based on the information.

好ましくは、本発明の動画像符号化装置は、前記2値化部により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化部を有する。Preferably, the moving image encoding apparatus of the present invention includes a provisional arithmetic encoding unit that calculates provisionally generated code amounts by provisionally arithmetically encoding the binary symbols converted by the binarization unit.

好ましくは、本発明の動画像符号化装置は、シンタックスデータを可逆圧縮するシンタックスデータ圧縮部と、前記シンタックスデータ圧縮部により圧縮されたシンタックスデータを記憶する圧縮シンタックスデータ記憶部と、前記圧縮シンタックスデータ記憶部から前記圧縮されたシンタックスデータを読み出して前記シンタックスデータを復元するシンタックスデータ復元部と、前記シンタックスデータ復元部により復元された前記シンタックスデータを2値化シンボルに変換する2値化部と、前記2値化部によって変換された2値化シンボルを算術符号化する算術符号化部とを有する。Preferably, the moving image encoding apparatus of the present invention includes a syntax data compression unit that reversibly compresses syntax data, and a compression syntax data storage unit that stores syntax data compressed by the syntax data compression unit. A syntax data restoring unit that reads the compressed syntax data from the compressed syntax data storage unit and restores the syntax data; and the syntax data restored by the syntax data restoring unit is binary A binarizing unit that converts the binarized symbol, and an arithmetic coding unit that arithmetically codes the binarized symbol converted by the binarizing unit.

好ましくは、本発明の動画像符号化装置は、前記シンタックスデータ圧縮部が、前記シンタックスデータをCAVLCで圧縮する。Preferably, in the moving image encoding apparatus of the present invention, the syntax data compression unit compresses the syntax data by CAVLC.

本発明は、動画像のデータ量を圧縮・削減するための動画像符号化装置に関するものである。 The present invention relates to a moving image encoding apparatus for compressing and reducing the amount of moving image data.

算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化可能とする Arithmetic coding circuit enables arithmetic coding not have a performance sufficient to handle the binary symbol generation amount increases suddenly.

本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行の中では、左端のマクロブロックから符号化を開始し、右に隣接したマクロブロックを順番に符号化する動画像符号化であって、
動画像符号化の処理が少なくとも2つの処理に分割され、当該分割された処理を行うステージが少なくとも2ステージ含まれ、当該ステージの中にシンタックスエレメントを2値化シンボルに変換する可変長符号化ステージが含まれるマクロブロックパイプラインを含み、
縦方向に連続する少なくとも2行であって、ピクチャ全体に含まれる前記マクロブロック行の総行数よりも少ない行数の前記マクロブロック行をひとまとまりとして選択し、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行に含まれるマクロブロックから最も下のマクロブロック行に含まれるマクロブロックまで順番に、各マクロブロック行の上に隣接したマクロブロック行に含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行に含まれ、当該直前投入マクロブロックより左に位置し、かつ当該直前投入マクロブロックが右上隣接マクロブロックではないマクロブロックを、前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記2値化シンボルが書き込まれる2値化シンボル記憶部と、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記2値化シンボル記憶部から前記2値化シンボルが読み出され、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで順次、各マクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記2値化シンボル記憶部から前記2値化シンボルが読み出され、当該読み出された2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元部と、
前記読み出された2値化シンボルを、前記復元されたコンテクスト情報に基づいて算術符号化する算術符号化部と
を有する。
The moving image encoding apparatus of the present invention starts encoding from the leftmost macroblock in the macroblock row that is a collection of macroblocks arranged in the horizontal direction from the left end to the right end of the picture, A video encoding unit that sequentially encodes adjacent macroblocks;
The moving image coding process is divided into at least two processes, and at least two stages for performing the divided processes are included, and variable length coding for converting syntax elements into binary symbols in the stages is included. Including a macroblock pipeline that includes stages,
Selecting the macroblock rows as a group with at least two rows that are continuous in the vertical direction and having a number of rows smaller than the total number of the macroblock rows included in the entire picture;
Injecting the macroblock included in the top macroblock row in the group of macroblock rows into the macroblock pipeline;
Macros adjacent on each macroblock row in order from the macroblock included in the second macroblock row from the top to the macroblock included in the bottommost macroblock row in the group of macroblock rows. After the previous input macroblock included in the block row is input to the macroblock pipeline, it is included in each macroblock row and is located to the left of the previous input macroblock, and the previous input macroblock is adjacent to the upper right. Put macroblocks that are not macroblocks into the macroblock pipeline
A moving image encoding unit;
A binarized symbol storage unit in which the binarized symbols are written in the variable length coding stage;
The binarized symbols are read from the binarized symbol storage unit in order from the leftmost macroblock to the rightmost macroblock for the uppermost macroblock row in the group of macroblock rows, The binarized symbol storage unit sequentially from the top macroblock row to the bottom macroblock row from the top to the bottom macroblock row in order from the leftmost macroblock to the rightmost macroblock for each macroblock row A context information restoration unit that reads out the binarized symbol from and restores the context information corresponding to the read binarized symbol;
An arithmetic encoding unit that arithmetically encodes the read binary symbol based on the restored context information;
Have

また、本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行の中では、左端のマクロブロックから符号化を開始し、右に隣接したマクロブロックを順番に符号化する動画像符号化部であって、
動画像符号化の処理が2以上の処理に分割され、当該分割された処理を行うステージが2ステージ以上含まれ、当該ステージの中にシンタックスエレメントを可逆圧縮して圧縮されたシンタックスエレメントを生成する可変長符号化ステージが含まれるマクロブロックパイプラインと、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行に含まれるマクロブロックから最も下のマクロブロック行に含まれるマクロブロックまで順番に、各マクロブロック行の上に隣接したマクロブロック行に含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行に含まれ、当該直前投入マクロブロックより左に位置し、かつ当該直前投入マクロブロックが右上隣接マクロブロックではないマクロブロックを、前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記圧縮されたシンタックスエレメントが書き込まれる圧縮シンタックスエレメント記憶部と、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで順次、各マクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、当該読み出された圧縮されたシンタックスエレメントから前記シンタックスエレメントを復元するシンタックスエレメント復元部と、
前記復元されたシンタックスエレメントを2値化シンボルに変換する2値化部と、
前記変換された2値化シンボルを算術符号化する算術符号化部と
を有する。
Further , the moving image encoding apparatus of the present invention starts encoding from the leftmost macroblock in the macroblock row which is a collection of macroblocks arranged in a row in the horizontal direction from the left end to the right end of the picture, A video encoding unit that sequentially encodes macroblocks adjacent to the right;
The video encoding process is divided into two or more processes, and two or more stages for performing the divided processes are included, and the syntax elements compressed by reversibly compressing the syntax elements are included in the stages. A macroblock pipeline that includes a variable-length encoding stage to be generated;
Injecting the macroblock included in the top macroblock row in the group of macroblock rows into the macroblock pipeline;
Macros adjacent on each macroblock row in order from the macroblock included in the second macroblock row from the top to the macroblock included in the bottommost macroblock row in the group of macroblock rows. After the previous input macroblock included in the block row is input to the macroblock pipeline, it is included in each macroblock row and is located to the left of the previous input macroblock, and the previous input macroblock is adjacent to the upper right. Put macroblocks that are not macroblocks into the macroblock pipeline
A moving image encoding unit;
A compressed syntax element storage unit in which the compressed syntax element is written in the variable length encoding stage;
The compressed syntax elements are read from the compressed syntax element storage unit in order from the leftmost macroblock to the rightmost macroblock for the uppermost macroblock row in the group of macroblock rows, The compression syntax elements in a group of macroblock rows from the top to the bottom macroblock row from the top to the bottom macroblock row in order from the leftmost macroblock to the rightmost macroblock for each macroblock row A syntax element restoring unit that reads the compressed syntax element from the storage unit and restores the syntax element from the read compressed syntax element;
A binarization unit that converts the restored syntax element into a binarized symbol;
An arithmetic encoding unit for arithmetically encoding the converted binary symbol;
Have

好ましくは、本発明の動画像符号化装置は、前記動画像符号化の処理が、動画像符号化規格H.264に準拠しており、
前記可変長符号化ステージが、前記シンタックスエレメントをCAVLCで圧縮する。
Preferably, in the moving image encoding apparatus of the present invention, the moving image encoding process is performed according to the moving image encoding standard H.264. H.264,
The variable length encoding stage compresses the syntax element with CAVLC.

好ましくは、本発明の動画像符号化装置は、ピクチャの最も上の前記ひとまとまりのマクロブロック行から符号化を開始し、下に隣接した前記ひとまとまりのマクロブロック行を順番に符号化する。 Preferably , the moving picture coding apparatus according to the present invention starts coding from the group of macroblock rows at the top of the picture, and sequentially codes the group of macroblock rows adjacent below.

また、本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を縦方向に隣接する2行ずつ組みにしてマクロブロック行の組を作成し、当該マクロブロック行の組に属する縦方向に隣接した2個のマクロブロックを組み合わせてマクロブロックペアを作成し、マクロブロックペアごとにフレーム符号化とフィールド符号化を選択して符号化を行い、前記マクロブロック行の組の中では、左端のマクロブロックペアから符号化を開始し、右に隣接したマクロブロックペアを順番に符号化する動画像符号化部であって、
動画像符号化の処理が4以上の処理に分割され、当該分割された処理を行うステージが4ステージ以上含まれ、当該ステージの中にシンタックスエレメントを2値化シンボルに変換する可変長符号化ステージが含まれるマクロブロックパイプラインと、
縦方向に連続する2組以上の前記マクロブロック行の組であって、ピクチャ全体に含まれる前記マクロブロック行の組の総数よりも少ない数の前記マクロブロック行の組をひとまとまりとして選択し、
前記ひとまとまりのマクロブロック行の組の中の最も上に位置するマクロブロック行の組に属するマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組の上に隣接したマクロブロック行の組に属するマクロブロックペアに含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行の組に属し、当該直前投入マクロブロックを含むマクロブロックペアより左に位置し、かつ当該直前投入マクロブロックを含むマクロブロックペアが右上隣接マクロブロックペアではないマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の最も下に位置するマクロブロック行の組に属するマクロブロックペアに含まれるマクロブロックが前記マクロブロックパイプラインに投入された後に、前記ひとまとまりのマクロブロック行の組みの中の最も上に位置するマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組に属し、片方のマクロブロックのみ前記マクロブロックパイプラインに投入済みである前記マクロブロックペアに含まれる、まだ前記マクロブロックパイプラインに投入されていない他の片方のマクロブロックを前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記2値化シンボルが書き込まれる2値化シンボル記憶部と、
前記ひとまとまりのマクロブロック行の組の中の最も上のマクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記2値化シンボル記憶部から前記2値化シンボルが読み出され、前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順次、各マクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記2値化シンボル記憶部から前記2値化シンボルが読み出され、当該読み出された2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元部と、
前記読み出された2値化シンボルを、前記復元されたコンテクスト情報に基づいて算術符号化する算術符号化部と
を有する。
The moving picture coding apparatus according to the present invention also includes a macroblock row in which macroblock rows, which are a set of macroblocks arranged in a row in the horizontal direction from the left end to the right end of a picture, are grouped into two adjacent rows in the vertical direction. A pair of macroblocks that are adjacent to each other in the macroblock row group and create a macroblock pair, and select frame coding and field coding for each macroblock pair. In the set of macroblock rows, encoding is started from the leftmost macroblock pair, and a moving picture encoding unit that sequentially encodes adjacent macroblock pairs on the right,
The moving image coding process is divided into four or more processes, and four or more stages for performing the divided processes are included, and variable length coding for converting syntax elements into binary symbols in the stages is included. A macroblock pipeline that includes stages,
A set of two or more sets of macroblock rows that are consecutive in the vertical direction, and a set of macroblock rows that is smaller than the total number of sets of macroblock rows included in the entire picture is selected as a group;
Select whether to encode the macroblock pair belonging to the topmost macroblock row set in the group of macroblock rows by frame encoding or field encoding, and select frame encoding When the frame encoding is selected, the upper frame macroblock included in the macroblock pair is input to the macroblock pipeline. When field coding is selected, one macroblock included in the macroblock pair is input to the macroblock pipeline. Throw in,
Macroblocks adjacent to each set of macroblock rows in order from the second set of macroblock rows from the top to the bottom set of macroblock rows in the set of macroblock rows After a previous input macroblock included in a macroblock pair belonging to a set of rows is input to the macroblock pipeline, the macroblock pair belonging to the set of each macroblock row and to the left of the macroblock pair including the previous input macroblock When a macro block pair that is located and the macro block pair including the immediately preceding input macro block is not the upper right adjacent macro block pair is to be encoded by frame encoding or field encoding, and frame encoding is selected Indicates the upper frame macroblock included in the macroblock pair as the macroblock. Tsu put into click pipeline, when you select the field coding charged with macroblocks of one included in the macroblock pair in the macroblock pipeline,
After a macroblock included in a macroblock pair belonging to the lowest set of macroblock rows in the set of macroblock rows is input to the macroblock pipeline, the set of macroblocks The macroblock pipeline belongs to each macroblock row set in order from the topmost macroblock row set to the bottommost macroblock row set in the row set, and only one macroblock belongs to the macroblock pipeline. The other one of the macroblocks included in the macroblock pair that has already been input but not yet input to the macroblock pipeline is input to the macroblock pipeline.
A moving image encoding unit;
A binarized symbol storage unit in which the binarized symbols are written in the variable length coding stage;
The binarized symbols are read from the binarized symbol storage unit in order from the leftmost macroblock pair to the rightmost macroblock pair for the uppermost macroblock row set in the group of macroblock rows. The leftmost macroblock for each set of macroblock rows in sequence, from the second set of macroblock rows to the lowest set of macroblock rows in the set of macroblock rows A context information restoring unit that reads the binarized symbols from the binarized symbol storage unit in order from the pair to the rightmost macroblock pair, and restores the context information corresponding to the read binarized symbols; ,
An arithmetic encoding unit that arithmetically encodes the read binary symbol based on the restored context information;
Have

また、本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を縦方向に隣接する2行ずつ組みにしてマクロブロック行の組を作成し、当該マクロブロック行の組に属する縦方向に隣接した2個のマクロブロックを組み合わせてマクロブロックペアを作成し、マクロブロックペアごとにフレーム符号化とフィールド符号化を選択して符号化を行い、前記マクロブロック行の組の中では、左端のマクロブロックペアから符号化を開始し、右に隣接したマクロブロックペアを順番に符号化する動画像符号化部であって、
動画像符号化の処理が4以上の処理に分割され、当該分割された処理を行うステージが4ステージ以上含まれ、当該ステージの中にシンタックスエレメントを可逆圧縮して圧縮されたシンタックスエレメントを生成する可変長符号化ステージが含まれるマクロブロックパイプラインと、
縦方向に連続する2組以上の前記マクロブロック行の組であって、ピクチャ全体に含まれる前記マクロブロック行の組の総数よりも少ない数の前記マクロブロック行の組をひとまとまりとして選択し、
前記ひとまとまりのマクロブロック行の組の中の最も上に位置するマクロブロック行の組に属するマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組の上に隣接したマクロブロック行の組に属するマクロブロックペアに含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行の組に属し、当該直前投入マクロブロックを含むマクロブロックペアより左に位置し、かつ当該直前投入マクロブロックを含むマクロブロックペアが右上隣接マクロブロックペアではないマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の最も下に位置するマクロブロック行の組に属するマクロブロックペアに含まれるマクロブロックが前記マクロブロックパイプラインに投入された後に、前記ひとまとまりのマクロブロック行の組みの中の最も上に位置するマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組に属し、片方のマクロブロックのみ前記マクロブロックパイプラインに投入済みである前記マクロブロックペアに含まれる、まだ前記マクロブロックパイプラインに投入されていない他の片方のマクロブロックを前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記圧縮されたシンタックスエレメントが書き込まれる圧縮シンタックスエレメント記憶部と、
前記ひとまとまりのマクロブロック行の組の中の最も上のマクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順次、各マクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、当該読み出された圧縮されたシンタックスエレメントから前記シンタックスエレメントを復元するシンタックスエレメント復元部と、
前記復元されたシンタックスエレメントを2値化シンボルに変換する2値化部と、
前記変換された2値化シンボルを算術符号化する算術符号化部と
を有する。
The moving picture coding apparatus according to the present invention also includes a macroblock row in which macroblock rows, which are a set of macroblocks arranged in a row in the horizontal direction from the left end to the right end of a picture, are grouped into two adjacent rows in the vertical direction. A pair of macroblocks that are adjacent to each other in the macroblock row group and create a macroblock pair, and select frame coding and field coding for each macroblock pair. In the set of macroblock rows, encoding is started from the leftmost macroblock pair, and a moving picture encoding unit that sequentially encodes adjacent macroblock pairs on the right,
The video encoding process is divided into four or more processes, and four or more stages for performing the divided processes are included, and the syntax element compressed by reversibly compressing the syntax element is included in the stage. A macroblock pipeline that includes a variable-length encoding stage to be generated;
A set of two or more sets of macroblock rows that are consecutive in the vertical direction, and a set of macroblock rows that is smaller than the total number of sets of macroblock rows included in the entire picture is selected as a group;
Select whether to encode the macroblock pair belonging to the topmost macroblock row set in the group of macroblock rows by frame encoding or field encoding, and select frame encoding When the frame encoding is selected, the upper frame macroblock included in the macroblock pair is input to the macroblock pipeline. When field coding is selected, one macroblock included in the macroblock pair is input to the macroblock pipeline. Throw in,
Macroblocks adjacent to each set of macroblock rows in order from the second set of macroblock rows from the top to the bottom set of macroblock rows in the set of macroblock rows After a previous input macroblock included in a macroblock pair belonging to a set of rows is input to the macroblock pipeline, the macroblock pair belonging to the set of each macroblock row and to the left of the macroblock pair including the previous input macroblock When a macro block pair that is located and the macro block pair including the immediately preceding input macro block is not the upper right adjacent macro block pair is to be encoded by frame encoding or field encoding, and frame encoding is selected Indicates the upper frame macroblock included in the macroblock pair as the macroblock. Tsu put into click pipeline, when you select the field coding charged with macroblocks of one included in the macroblock pair in the macroblock pipeline,
After a macroblock included in a macroblock pair belonging to the lowest set of macroblock rows in the set of macroblock rows is input to the macroblock pipeline, the set of macroblocks The macroblock pipeline belongs to each macroblock row set in order from the topmost macroblock row set to the bottommost macroblock row set in the row set, and only one macroblock belongs to the macroblock pipeline. The other one of the macroblocks included in the macroblock pair that has already been input but not yet input to the macroblock pipeline is input to the macroblock pipeline.
A moving image encoding unit;
A compressed syntax element storage unit in which the compressed syntax element is written in the variable length encoding stage;
The compressed syntax element from the compressed syntax element storage unit in order from the leftmost macroblock pair to the rightmost macroblock pair for the uppermost macroblock row set in the set of macroblock rows. Are sequentially read from the second set of macroblock rows to the lowest set of macroblock rows in the set of macroblock rows, and the leftmost for each set of macroblock rows. The compressed syntax element is read from the compressed syntax element storage unit in order from the macro block pair to the rightmost macro block pair, and the syntax element is restored from the compressed syntax element that has been read. A syntax element restoration unit to perform,
A binarization unit that converts the restored syntax element into a binarized symbol;
An arithmetic encoding unit for arithmetically encoding the converted binary symbol;
Have

好ましくは、本発明の動画像符号化装置は、前記動画像符号化の処理が、動画像符号化規格H.264に準拠しており、
前記可変長符号化ステージが、前記シンタックスエレメントをCAVLCで圧縮する。
Preferably, in the moving image encoding apparatus of the present invention, the moving image encoding process is performed according to the moving image encoding standard H.264. H.264,
The variable length encoding stage compresses the syntax element with CAVLC.

好ましくは、本発明の動画像符号化装置は、ピクチャの最も上の前記ひとまとまりのマクロブロック行の組から符号化を開始し、下に隣接した前記ひとまとまりのマクロブロック行の組を順番に符号化する。 Preferably, the moving picture coding apparatus according to the present invention starts coding from the set of macroblock rows at the top of a picture, and sequentially sets the set of macroblock rows adjacent below. Encode.

本発明によれば、算術符号化回路が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができる。特に、2値化シンボル記憶回路にIピクチャの2値化シンボルとその前後のPピクチャやBピクチャの2値化シンボルを記憶できるだけの十分な記憶容量を持たせれば、算術符号化回路の性能がIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できる性能を下回っていても算術符号化することができる。 According to the present invention, arithmetic coding can be performed even if the arithmetic coding circuit does not have a performance sufficient to process a binarized symbol generation amount that suddenly increases. In particular, if the binarized symbol storage circuit has sufficient storage capacity to store the binarized symbols of the I picture and the binarized symbols of the P picture and B picture before and after the I symbol, the performance of the arithmetic coding circuit can be improved. Arithmetic coding can be performed even if the performance of the binarized symbol generation amount that suddenly occurs in the I picture is less than the capability of processing.

また、あるMBの2値化シンボルの発生量が突発的に増加し、仮算術符号化した結果真の算術符号化回路の処理能力を超えると予測されるときにはそのMBを含むピクチャ全体をCAVLC符号化し、一方、仮算術符号化した結果真の算術符号化回路で処理できると予測されるときにはそのMBを含むピクチャ全体をCABAC符号化することができる。これにより、真の算術符号化回路の性能が不測するという状況を確実に回避できる。更に、CAVLC符号化回路でCAVLC符号化ビットストリームの符号量を算出し、CAVLC符号化と仮算術符号化の仮発生符号量を比較して、ピクチャごとに発生符号量が少ないと推測されるエントロピー符号化モードを選択することもできる。 In addition , when the amount of binarized symbols generated in a certain MB suddenly increases and is predicted to exceed the processing capability of a true arithmetic encoding circuit as a result of provisional arithmetic encoding, the entire picture including that MB is encoded by the CAVLC code. On the other hand, when it is predicted that the result can be processed by a true arithmetic encoding circuit as a result of provisional arithmetic encoding, the entire picture including the MB can be CABAC encoded. As a result, a situation in which the performance of the true arithmetic coding circuit is unexpected can be surely avoided. Furthermore, the CAVLC encoding circuit calculates the code amount of the CAVLC encoded bitstream, compares the temporarily generated code amount of CAVLC encoding and provisional arithmetic encoding, and entropy that is estimated to be small for each picture. An encoding mode can also be selected.

以下、本発明の実施の形態に係る動画像符号化装置を図面に基づいて説明する。
Hereinafter, a moving picture coding apparatus according to an embodiment of the present invention will be described with reference to the drawings.

本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行の中では、左端のマクロブロックから符号化を開始し、右に隣接したマクロブロックを順番に符号化する動画像符号化部であって、
動画像符号化の処理が少なくとも2つの処理に分割され、当該分割された処理を行うステージが少なくとも2ステージ含まれ、当該ステージの中にシンタックスエレメントを可逆圧縮して圧縮されたシンタックスエレメントを生成する可変長符号化ステージが含まれるマクロブロックパイプラインを含み、
縦方向に連続する少なくとも2行であって、ピクチャ全体に含まれる前記マクロブロック行の総行数よりも少ない行数の前記マクロブロック行をひとまとまりとして選択し、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に含まれるマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行に含まれるマクロブロックから最も下のマクロブロック行に含まれるマクロブロックまで順番に、各マクロブロック行の上に隣接したマクロブロック行に含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行に含まれ、当該直前投入マクロブロックより左に位置し、かつ当該直前投入マクロブロックが右上隣接マクロブロックではないマクロブロックを、前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記圧縮されたシンタックスエレメントが書き込まれる圧縮シンタックスエレメント記憶部と、
前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、前記ひとまとまりのマクロブロック行の中の上から2行目のマクロブロック行から最も下のマクロブロック行まで順次、各マクロブロック行について左端のマクロブロックから右端のマクロブロックまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、当該読み出された圧縮されたシンタックスエレメントから前記シンタックスエレメントを復元するシンタックスエレメント復元部と、
前記復元されたシンタックスエレメントを2値化シンボルに変換する2値化部と、
前記変換された2値化シンボルを算術符号化する算術符号化部と
を有する。
The moving picture encoding apparatus of the present invention starts encoding from the leftmost macroblock in the macroblock row which is a collection of macroblocks arranged in the horizontal direction from the left end to the right end of the picture, and A video encoding unit that sequentially encodes adjacent macroblocks;
The video encoding process is divided into at least two processes, and at least two stages for performing the divided processes are included, and a syntax element compressed by lossless compression of the syntax element is included in the stage. Including a macroblock pipeline that includes a variable length encoding stage to generate ,
Selecting the macroblock rows as a group at least two rows that are continuous in the vertical direction and having a number smaller than the total number of the macroblock rows included in the entire picture;
Injecting the macroblock included in the top macroblock row in the group of macroblock rows into the macroblock pipeline;
Macros adjacent on each macroblock row in order from the macroblock included in the second macroblock row from the top to the macroblock included in the lowest macroblock row in the group of macroblock rows. After the previous input macroblock included in the block row is input to the macroblock pipeline, it is included in each macroblock row and is located to the left of the previous input macroblock, and the immediately preceding macroblock is adjacent to the upper right. A video encoding unit that inputs macroblocks that are not macroblocks into the macroblock pipeline;
A compressed syntax element storage unit in which the compressed syntax element is written in the variable length encoding stage;
The compressed syntax elements are read from the compressed syntax element storage unit in order from the leftmost macroblock to the rightmost macroblock for the uppermost macroblock row in the group of macroblock rows, The compression syntax elements in a group of macroblock rows from the top to the bottom macroblock row from the top to the bottom macroblock row in order from the leftmost macroblock to the rightmost macroblock for each macroblock row A syntax element restoring unit that reads the compressed syntax element from the storage unit and restores the syntax element from the read compressed syntax element;
A binarization unit that converts the restored syntax element into a binarized symbol;
An arithmetic encoding unit that arithmetically encodes the converted binary symbol .

好ましくは、本発明の動画像符号化装置は、前記動画像符号化の処理が、動画像符号化規格H.264に準拠しており、
前記可変長符号化ステージが、前記シンタックスエレメントをCAVLCで圧縮する。
Preferably , in the moving image encoding apparatus of the present invention, the moving image encoding process is performed according to the moving image encoding standard H.264. H.264,
The variable length encoding stage compresses the syntax element with CAVLC.

好ましくは、本発明の動画像符号化装置は、ピクチャの最も上の前記ひとまとまりのマクロブロック行から符号化を開始し、下に隣接した前記ひとまとまりのマクロブロック行を順番に符号化する。 Preferably, the moving picture coding apparatus according to the present invention starts coding from the uppermost group of macroblock rows of a picture, and sequentially encodes the lowermost group of macroblock rows adjacent to each other.

好ましくは、本発明の動画像符号化装置は、前記動画像符号化部を少なくとも2つ有する。 Preferably, the moving image encoding device of the present invention includes at least two moving image encoding units.

また、本発明の動画像符号化装置は、ピクチャの左端から右端まで横方向に連続して並んだマクロブロックの集まりであるマクロブロック行を縦方向に隣接する2行ずつ組みにしてマクロブロック行の組を作成し、当該マクロブロック行の組に属する縦方向に隣接した2個のマクロブロックを組み合わせてマクロブロックペアを作成し、マクロブロックペアごとにフレーム符号化とフィールド符号化を選択して符号化を行い、前記マクロブロック行の組の中では、左端のマクロブロックペアから符号化を開始し、右に隣接したマクロブロックペアを順番に符号化する動画像符号化部であって、
動画像符号化の処理が4以上の処理に分割され、当該分割された処理を行うステージが4ステージ以上含まれ、当該ステージの中にシンタックスエレメントを可逆圧縮して圧縮されたシンタックスエレメントを生成する可変長符号化ステージが含まれるマクロブロックパイプラインを含み、
縦方向に連続する2組以上の前記マクロブロック行の組であって、ピクチャ全体に含まれる前記マクロブロック行の組の総数よりも少ない数の前記マクロブロック行の組をひとまとまりとして選択し、
前記ひとまとまりのマクロブロック行の組の中の最も上に位置するマクロブロック行の組に属するマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組の上に隣接したマクロブロック行の組に属するマクロブロックペアに含まれる直前投入マクロブロックが前記マクロブロックパイプラインに投入された後に、当該各マクロブロック行の組に属し、当該直前投入マクロブロックを含むマクロブロックペアより左に位置し、かつ当該直前投入マクロブロックを含むマクロブロックペアが右上隣接マクロブロックペアではないマクロブロックペアをフレーム符号化とフィールド符号化のいずれで符号化するか選択し、フレーム符号化を選択したときは当該マクロブロックペアに含まれる上フレームマクロブロックを前記マクロブロックパイプラインに投入し、フィールド符号化を選択したときは当該マクロブロックペアに含まれる片方のマクロブロックを前記マクロブロックパイプラインに投入し、
前記ひとまとまりのマクロブロック行の組の中の最も下に位置するマクロブロック行の組に属するマクロブロックペアに含まれるマクロブロックが前記マクロブロックパイプラインに投入された後に、前記ひとまとまりのマクロブロック行の組みの中の最も上に位置するマクロブロック行の組から最も下に位置するマクロブロック行の組まで順番に、各マクロブロック行の組に属し、片方のマクロブロックのみ前記マクロブロックパイプラインに投入済みである前記マクロブロックペアに含まれる、まだ前記マクロブロックパイプラインに投入されていない他の片方のマクロブロックを前記マクロブロックパイプラインに投入する
動画像符号化部と、
前記可変長符号化ステージにおいて前記圧縮されたシンタックスエレメントが書き込まれる圧縮シンタックスエレメント記憶部と、
前記ひとまとまりのマクロブロック行の組の中の最も上のマクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、前記ひとまとまりのマクロブロック行の組の中の上から2番目のマクロブロック行の組から最も下に位置するマクロブロック行の組まで順次、各マクロブロック行の組について左端のマクロブロックペアから右端のマクロブロックペアまで順番に前記圧縮シンタックスエレメント記憶部から前記圧縮されたシンタックスエレメントが読み出され、当該読み出された圧縮されたシンタックスエレメントから前記シンタックスエレメントを復元するシンタックスエレメント復元部と、
前記復元されたシンタックスエレメントを2値化シンボルに変換する2値化部と、
前記変換された2値化シンボルを算術符号化する算術符号化部と
を有する。
The moving picture coding apparatus according to the present invention also includes a macroblock row in which macroblock rows, which are a set of macroblocks arranged in a row in the horizontal direction from the left end to the right end of a picture, are grouped into two adjacent rows in the vertical direction. A pair of macroblocks that are adjacent to each other in the macroblock row group and create a macroblock pair, and select frame coding and field coding for each macroblock pair. In the set of macroblock rows, encoding is started from the leftmost macroblock pair, and a moving picture encoding unit that sequentially encodes adjacent macroblock pairs on the right,
The video encoding process is divided into four or more processes, and four or more stages for performing the divided processes are included, and the syntax element compressed by reversibly compressing the syntax element is included in the stage. Including a macroblock pipeline that includes a variable length encoding stage to generate,
A set of two or more sets of macroblock rows that are consecutive in the vertical direction, and a set of macroblock rows that is smaller than the total number of sets of macroblock rows included in the entire picture is selected as a group;
Select whether to encode the macroblock pair belonging to the topmost macroblock row set in the group of macroblock rows by frame encoding or field encoding, and select frame encoding When the frame encoding is selected, the upper frame macroblock included in the macroblock pair is input to the macroblock pipeline. When field coding is selected, one macroblock included in the macroblock pair is input to the macroblock pipeline. Throw in,
Macroblocks adjacent to each set of macroblock rows in order from the second set of macroblock rows from the top to the bottom set of macroblock rows in the set of macroblock rows After a previous input macroblock included in a macroblock pair belonging to a set of rows is input to the macroblock pipeline, the macroblock pair belonging to the set of each macroblock row and to the left of the macroblock pair including the previous input macroblock When a macro block pair that is located and the macro block pair including the immediately preceding input macro block is not the upper right adjacent macro block pair is to be encoded by frame encoding or field encoding, and frame encoding is selected Indicates the upper frame macroblock included in the macroblock pair as the macroblock. Tsu put into click pipeline, when you select the field coding charged with macroblocks of one included in the macroblock pair in the macroblock pipeline,
After a macroblock included in a macroblock pair belonging to the lowest set of macroblock rows in the set of macroblock rows is input to the macroblock pipeline, the set of macroblocks The macroblock pipeline belongs to each macroblock row set in order from the topmost macroblock row set to the bottommost macroblock row set in the row set, and only one macroblock belongs to the macroblock pipeline. A video encoding unit that inputs the other macroblock included in the macroblock pair that has already been input to the macroblock pipeline and that has not yet been input to the macroblock pipeline;
A compressed syntax element storage unit in which the compressed syntax element is written in the variable length encoding stage;
The compressed syntax element from the compressed syntax element storage unit in order from the leftmost macroblock pair to the rightmost macroblock pair for the uppermost macroblock row set in the set of macroblock rows. Are sequentially read from the second set of macroblock rows to the lowest set of macroblock rows in the set of macroblock rows, and the leftmost for each set of macroblock rows. The compressed syntax element is read from the compressed syntax element storage unit in order from the macro block pair to the rightmost macro block pair, and the syntax element is restored from the compressed syntax element that has been read. A syntax element restoration unit to perform,
A binarization unit that converts the restored syntax element into a binarized symbol;
An arithmetic encoding unit that arithmetically encodes the converted binary symbol .

好ましくは、本発明の動画像符号化装置は、前記動画像符号化の処理が、動画像符号化規格H.264に準拠しており、
前記可変長符号化ステージが、前記シンタックスエレメントをCAVLCで圧縮する。
Preferably , in the moving image encoding apparatus of the present invention, the moving image encoding process is performed according to the moving image encoding standard H.264. H.264,
The variable length encoding stage compresses the syntax element with CAVLC.

好ましくは、本発明の動画像符号化装置は、ピクチャの最も上の前記ひとまとまりのマクロブロック行の組から符号化を開始し、下に隣接した前記ひとまとまりのマクロブロック行の組を順番に符号化する。 Preferably, the moving picture coding apparatus according to the present invention starts coding from the set of macroblock rows at the top of a picture, and sequentially sets the set of macroblock rows adjacent below. Encode.

好ましくは、本発明の動画像符号化装置は、前記動画像符号化部を少なくとも2つ有する。 Preferably, the moving image encoding device of the present invention includes at least two moving image encoding units.

本発明によれば、算術符号化が突発的に増加する2値化シンボル発生量を処理できるだけの性能を有していなくても算術符号化することができる。特に、圧縮シンタックスエレメント記憶部にIピクチャの圧縮されたシンタックスエレメントとその前後のPピクチャやBピクチャの圧縮されたシンタックスエレメントを記憶できるだけの十分な記憶容量を持たせれば、算術符号化の性能がIピクチャにおいて突発的に発生する2値化シンボル発生量を処理できる性能を下回っていても算術符号化することができる。
According to the present invention, arithmetic coding can be performed even if the arithmetic coding unit does not have a performance sufficient to process a binarized symbol generation amount that suddenly increases. In particular, if have sufficient storage capacity to the compression syntax element storage unit and the compressed syntax elements of I-pictures can be stored compressed syntax elements before and after the P-picture and B-picture, the arithmetic coding part performance can be arithmetic coding even below the suddenly can handle binary symbol generation amount for generating performance in I-picture.

Claims (10)

動画像符号化の処理を複数のステージに分割してパイプライン的に実行する第1の手段と、
縦に連続するm(mは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択する第2の手段と、
前記第2の手段によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記第1の手段に設定する第3の手段と、
を有し、
前記第3の手段によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要なデータが前記第1の手段に設定されると、前記第2の手段は、前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択する
ことを特徴とする動画像符号化装置。
A first means for dividing a moving image encoding process into a plurality of stages and executing it in a pipeline;
A macro block row of m (m is an integer of 2 or more) that is vertically continuous is taken as a group, and a macro block belonging to the uppermost macro block row in the group of macro block rows is a lower left adjacent macro block. For a macroblock belonging to a macroblock row other than the topmost macroblock row in the group of macroblock rows, a macroblock whose upper right adjacent macroblock has already been selected is selected. A second means for selecting one macroblock per macroblock row by selecting one macroblock included in the group of macroblock rows;
For each macroblock selected by the second means, m from the macroblock belonging to the uppermost macroblock row to the macroblock belonging to the lowermost macroblock row in the group of macroblock rows. A third means for setting data necessary for encoding individual macroblocks in each macroblock cycle in the first means in order over the macroblock cycles;
Have
When the data required for encoding the macroblock belonging to the lowest macroblock row in the group of macroblock rows is set in the first means by the third means, the second means Means for newly selecting the right adjacent macroblock for each of the selected macroblocks.
縦に隣接する2つのマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置であって、
動画像符号化の処理を複数のステージに分割してパイプライン的に実行する第1の手段と、
縦に連続する2n(nは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペアを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つ以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペアを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペアを2マクロブロック行当たり1個選択する第2の手段と、
前記第2の手段によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロックを構成し、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックを構成し、一方、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロックを構成し、マクロブロックペアの下半分のラインで下フレームマクロブロックを構成する第3の手段と、
前記第2の手段によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータを前記第1の手段に設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち最初に設定されなかった他の片方を符号化するために必要なデータを前記第1の手段に設定し、一方、フレーム符号化が選択されたときは、最初に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータを前記第1の手段に設定し、2回目に、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータを前記第1の手段に設定する第4の手段と、
を有し、
前記第4の手段によって、2回目に、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記第1の手段に設定されると、前記第2の手段は、前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペアを新たに選択する
ことを特徴とする動画像符号化装置。
A moving picture encoding apparatus that combines two vertically adjacent macroblocks into a macroblock pair, and switches between field encoding and frame encoding for each macroblock pair,
A first means for dividing a moving image encoding process into a plurality of stages and executing it in a pipeline;
A group of 2n (n is an integer greater than or equal to 2) macroblock rows that are vertically continuous, and a macroblock pair that belongs to the two highest macroblock rows in the group of macroblock rows, For a macroblock pair belonging to a macroblock row other than the top two macroblock rows in the group of macroblock rows, and a macroblock pair for which the lower left adjacent macroblock pair has not yet been selected is selected, A second means for selecting one macroblock pair included in the batch of macroblock rows per two macroblock rows by selecting a macroblock pair whose upper right adjacent macroblock pair has already been selected;
When field coding is selected for the macroblock pair selected by the second means, a top field macroblock is formed by an odd line of the macroblock pair, and a bottom field macroblock is formed by an even line of the macroblock pair. On the other hand, when frame encoding is selected, the upper frame macroblock is composed of the upper half line of the macroblock pair, and the lower frame macroblock is composed of the lower half line of the macroblock pair. 3 means,
When field coding is selected for the macroblock pair selected by the second means, first, the macros belonging to the top two macroblock rows in the group of macroblock rows From the block pair to the macroblock pair belonging to the two lowest-most macroblock rows in the group of macroblock rows, the individual macroblocks in each macroblock cycle in order over n macroblock cycles Data necessary for encoding one of the macroblocks included in the pair is set in the first means, and the second two macroblocks located at the top of the group of macroblock rows are set for the second time. From the macroblock pairs belonging to the row, the most in the group of macroblock rows Other macroblocks that are not set first among the macroblocks included in each macroblock pair in order of n macroblock cycles in order up to macroblock pairs belonging to two macroblock rows located at The data required to encode one is set in the first means, while when frame encoding is selected, it is first located at the top of the group of macroblock rows From one macroblock pair belonging to two macroblock rows to one macroblock pair belonging to the two lowermost macroblock rows in the group of macroblock rows, one macroblock in order over n macroblock cycles Upper frame macroblocks included in individual macroblock pairs in each block cycle Is set in the first means, and the second time, from the macroblock pair belonging to the top two macroblock rows in the group of macroblock rows, The macroblock pairs belonging to the two lowest macroblock rows in the group of macroblock rows are included in each macroblock pair in every macroblock cycle in order over n macroblock cycles. A fourth means for setting data necessary for encoding the lower frame macroblock in the first means;
Have
Data necessary for encoding a macroblock included in a macroblock pair belonging to the lowest two macroblock rows in the group of macroblock rows by the fourth means for the second time Is set in the first means, the second means newly selects a right adjacent macroblock pair for each of the selected macroblock pairs. Device.
前記第1の手段における一部のステージで、マクロブロックサイクルがサブブロックサイクルに分割され、サブブロックサイクルではサブブロックごとの処理が行われる
ことを特徴とする請求項1または請求項2記載の動画像符号化装置。
3. The moving image according to claim 1, wherein a macroblock cycle is divided into sub-block cycles in a part of stages in the first means, and processing for each sub-block is performed in the sub-block cycle. 4. Image encoding device.
請求項1から請求項3までのいずれか1項に記載された動画像符号化装置をa台(aは2以上の整数)含む並列動画像符号化装置であって、
ピクチャが前記ひとまとまりのマクロブロック行ごとに分割され、この分割された分割領域ごとに1台の動画像符号化装置が割り当てられ、a個の縦に連続した分割領域がa台の動画像符号化装置によって並列に符号化される
ことを特徴とする並列動画像符号化装置。
A parallel video encoding device including a video encoding device according to any one of claims 1 to 3 (a is an integer of 2 or more),
A picture is divided for each group of macroblock rows, and one moving picture coding device is assigned to each divided divided area, and a vertically divided divided area is a moving picture code. A parallel moving image encoding device encoded in parallel by an encoding device.
シンタックスデータを2値化シンボルに変換する2値化手段と、
前記2値化手段によって変換された2値化シンボルを記憶する2値化シンボル記憶手段と、
前記2値化シンボル記憶手段から読み出した2値化シンボルに対応するコンテクスト情報を復元するコンテクスト情報復元手段と、
前記2値化シンボル記憶手段から読み出した2値化シンボルを、前記コンテクスト情報復元手段により復元されたコンテクスト情報に基づいて算術符号化する算術符号化手段と、
を有することを特徴とする請求項1から請求項4までのいずれか1項記載の動画像符号化装置。
Binarization means for converting syntax data into binarized symbols;
Binary symbol storage means for storing the binary symbol converted by the binarization means;
Context information restoring means for restoring context information corresponding to the binarized symbol read from the binarized symbol storage means;
Arithmetic coding means for arithmetically coding the binarized symbol read from the binary symbol storage means based on the context information restored by the context information restoration means;
5. The moving picture encoding apparatus according to claim 1, further comprising:
前記2値化手段により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化手段を、
有することを特徴とする請求項5記載の動画像符号化装置。
Provisional arithmetic coding means for calculating a provisional generated code amount by provisional arithmetic coding of the binarized symbol converted by the binarization means;
6. The moving picture coding apparatus according to claim 5, further comprising:
シンタックスデータを可逆圧縮するシンタックスデータ圧縮手段と、
前記シンタックスデータ圧縮手段により圧縮されたシンタックスデータを記憶する圧縮シンタックスデータ記憶手段と、
前記圧縮シンタックスデータ記憶手段から圧縮されたシンタックスデータを読み出してシンタックスデータを復元するシンタックスデータ復元手段と、
前記シンタックスデータ復元手段により復元されたシンタックスデータを2値化シンボルに変換する2値化手段と、
前記2値化手段によって変換された2値化シンボルを算術符号化する算術符号化手段と、
を有することを特徴とする請求項1から請求項4までのいずれか1項記載の動画像符号化装置。
Syntax data compression means for reversibly compressing syntax data;
Compression syntax data storage means for storing syntax data compressed by the syntax data compression means;
Syntax data restoring means for reading the compressed syntax data from the compressed syntax data storage means and restoring the syntax data;
Binarization means for converting the syntax data restored by the syntax data restoration means into binarized symbols;
Arithmetic coding means for arithmetically coding the binarized symbols converted by the binarizing means;
5. The moving picture encoding apparatus according to claim 1, further comprising:
シンタックスデータを2値化シンボルに変換する2値化手段と、
前記2値化手段により変換された2値化シンボルを仮算術符号化して仮発生符号量を算出する仮算術符号化手段と、
シンタックスデータをCAVLC符号化するCAVLC符号化手段と、
前記CAVLC符号化手段により生成されたCAVLC符号化ビットストリームを記憶するCAVLC符号化ビットストリーム記憶手段と、
前記CAVLC符号化ビットストリーム記憶手段からCAVLC符号化ビットストリームを読み出してシンタックスデータを復号するCAVLC復号手段と、
前記CAVLC復号手段によって復号されたシンタックスデータを2値化シンボルに変換する第2の2値化手段と、
前記第2の2値化手段によって変換された2値化シンボルを算術符号化する算術符号化手段と、
を有することを特徴とする請求項1から請求項4までのいずれか1項記載の動画像符号化装置。
Binarization means for converting syntax data into binarized symbols;
Provisional arithmetic coding means for provisionally arithmetically coding the binarized symbol converted by the binarization means to calculate a provisionally generated code amount;
CAVLC encoding means for CAVLC encoding syntax data;
CAVLC encoded bitstream storage means for storing the CAVLC encoded bitstream generated by the CAVLC encoding means;
CAVLC decoding means for reading a CAVLC encoded bitstream from the CAVLC encoded bitstream storage means and decoding syntax data;
Second binarization means for converting the syntax data decoded by the CAVLC decoding means into binarized symbols;
Arithmetic coding means for arithmetically coding the binarized symbols converted by the second binarizing means;
5. The moving picture encoding apparatus according to claim 1, further comprising:
動画像符号化の処理を複数のステージに分割してパイプライン的に実行する符号化手段を有する動画像符号化装置において、
縦に連続するm(mは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックについては、左下隣接マクロブロックがまだ選択されていないマクロブロックを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上以外のマクロブロック行に属するマクロブロックについては、右上隣接マクロブロックが既に選択されているマクロブロックを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックを1マクロブロック行当たり1個選択する第1の手順と、
前記第1の手順によって選択された個々のマクロブロックについて、前記ひとまとまりのマクロブロック行の中の最も上のマクロブロック行に属するマクロブロックから、最も下のマクロブロック行に属するマクロブロックまで、mマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第2の手順と、
を有し、
前記第2の手順によって前記ひとまとまりのマクロブロック行の中の最も下のマクロブロック行に属するマクロブロックを符号化するために必要なデータが前記符号化手段に設定されると、前記第1の手順に戻り、前記選択されている個々のマクロブロックごとにその右隣接マクロブロックを新たに選択する
ことを特徴とする動画像符号化方法。
In a moving image encoding apparatus having an encoding unit that executes a moving image encoding process into a plurality of stages and executes in a pipeline manner,
A macro block row of m (m is an integer of 2 or more) that is vertically continuous is taken as a group, and a macro block belonging to the uppermost macro block row in the group of macro block rows is a lower left adjacent macro block. For a macroblock belonging to a macroblock row other than the topmost macroblock row in the group of macroblock rows, a macroblock whose upper right adjacent macroblock has already been selected is selected. A first procedure for selecting one macroblock per macroblock row by selecting, the macroblock included in the group of macroblock rows;
For each macroblock selected by the first procedure, m from the macroblock belonging to the uppermost macroblock row in the group of macroblock rows to the macroblock belonging to the lowermost macroblock row. A second procedure for setting data necessary for encoding individual macroblocks in one macroblock cycle in the encoding means in order over the macroblock cycles;
Have
When data necessary for encoding a macroblock belonging to the lowest macroblock row in the group of macroblock rows is set in the encoding means by the second procedure, the first means Returning to the procedure, a video encoding method characterized by newly selecting a right adjacent macroblock for each selected macroblock.
動画像符号化の処理を複数のステージに分割してパイプライン的に実行する符号化手段を有し、縦に隣接する2つのマクロブロックを組み合わせてマクロブロックペアとし、マクロブロックペアごとにフィールド符号化とフレーム符号化を切り替えて符号化する動画像符号化装置において、
縦に連続する2n(nは2以上の整数)のマクロブロック行をひとまとまりとし、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアについては、左下隣接マクロブロックペアがまだ選択されていないマクロブロックペアを選択し、かつ、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つ以外のマクロブロック行に属するマクロブロックペアについては、右上隣接マクロブロックペアが既に選択されているマクロブロックペアを選択することによって、前記ひとまとまりのマクロブロック行に含まれるマクロブロックペアを2マクロブロック行当たり1個選択する第1の手順と、
前記第1の手順により選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、マクロブロックペアの奇数ラインでトップフィールドマクロブロックを構成し、マクロブロックペアの偶数ラインでボトムフィールドマクロブロックを構成し、一方、フレーム符号化が選択されたときは、マクロブロックペアの上半分のラインで上フレームマクロブロックを構成し、マクロブロックペアの下半分のラインで下フレームマクロブロックを構成する第2の手順と、
前記第1の手順によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックの片方を符号化するために必要なデータを前記符号化手段に設定し、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる上フレームマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第3の手順と、
前記第1の手順によって選択されたマクロブロックペアについて、フィールド符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれるマクロブロックのうち前記第3の手順により設定されなかった他の片方を符号化するために必要なデータを前記符号化手段に設定し、一方、フレーム符号化が選択されたときは、前記ひとまとまりのマクロブロック行の中の最も上に位置する2つのマクロブロック行に属するマクロブロックペアから、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアまで、nマクロブロックサイクルかけて順番に、1マクロブロックサイクルごとに個々のマクロブロックペアに含まれる下フレームマクロブロックを符号化するために必要なデータを前記符号化手段に設定する第4の手順と、
を有し、
前記第4の手順によって、前記ひとまとまりのマクロブロック行の中の最も下に位置する2つのマクロブロック行に属するマクロブロックペアに含まれるマクロブロックを符号化するために必要なデータが前記符号化手段に設定されると、前記第1の手順に戻り、前記選択されている個々のマクロブロックペアごとにその右隣接マクロブロックペアを新たに選択する
ことを特徴とする動画像符号化方法。
It has an encoding means that divides moving image encoding processing into a plurality of stages and executes it in a pipeline manner, and combines two vertically adjacent macroblocks into a macroblock pair, and a field code for each macroblock pair. In a video encoding device that performs encoding by switching between encoding and frame encoding,
A group of 2n (n is an integer greater than or equal to 2) macroblock rows that are vertically continuous, and a macroblock pair that belongs to the two highest macroblock rows in the group of macroblock rows, For a macroblock pair belonging to a macroblock row other than the top two macroblock rows in the group of macroblock rows, and a macroblock pair for which the lower left adjacent macroblock pair has not yet been selected is selected, A first procedure of selecting one macroblock pair included in the batch of macroblock rows per two macroblock rows by selecting a macroblock pair whose upper right adjacent macroblock pair has already been selected;
When field coding is selected for the macroblock pair selected by the first procedure, a top field macroblock is formed by an odd line of the macroblock pair, and a bottom field macroblock is formed by an even line of the macroblock pair. On the other hand, when frame encoding is selected, the upper frame macroblock is composed of the upper half line of the macroblock pair, and the lower frame macroblock is composed of the lower half line of the macroblock pair. 2 steps,
When field coding is selected for the macroblock pair selected by the first procedure, from the macroblock pairs belonging to the two highest macroblock rows in the group of macroblock rows. , Up to the macroblock pair belonging to the two lowermost macroblock rows in the group of macroblock rows, in order of n macroblock cycles, included in each macroblock pair in every macroblock cycle The data necessary for encoding one of the macroblocks to be encoded is set in the encoding means, while when frame encoding is selected, it is positioned at the top of the group of macroblock rows. From the macroblock pairs belonging to two macroblock rows, the set of macros Up to the macro block pair belonging to the two lowest macro block rows in the block row, the upper frame macro block included in each macro block pair is sequentially added every n macro block cycles over n macro block cycles. A third procedure for setting the data necessary for encoding in the encoding means;
When field coding is selected for the macroblock pair selected by the first procedure, from the macroblock pairs belonging to the two highest macroblock rows in the group of macroblock rows. , Up to the macroblock pair belonging to the two lowermost macroblock rows in the group of macroblock rows, in order of n macroblock cycles, included in each macroblock pair in every macroblock cycle Data necessary for encoding the other one of the macroblocks not set by the third procedure is set in the encoding means. On the other hand, when frame encoding is selected, the one of the macroblocks is set. The macros belonging to the top two macroblock rows in a group of macroblock rows From macroblock pairs to macroblock pairs belonging to the two lowest-most macroblock rows in the group of macroblock rows, each macroblock cycle in turn takes n macroblock cycles. A fourth procedure for setting, in the encoding means, data necessary for encoding the lower frame macroblock included in the block pair;
Have
According to the fourth procedure, data necessary for encoding a macroblock included in a macroblock pair belonging to the two lowest macroblock rows in the group of macroblock rows is encoded. If set to the means, the method returns to the first procedure, and the right adjacent macroblock pair is newly selected for each selected macroblock pair.
JP2006144890A 2006-04-17 2006-05-25 Video encoding device Expired - Fee Related JP4062711B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2006144890A JP4062711B2 (en) 2006-04-17 2006-05-25 Video encoding device
PCT/JP2007/000292 WO2007129433A1 (en) 2006-04-17 2007-03-26 Dynamic image encoding device and dynamic image encoding method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2006113925 2006-04-17
JP2006113925 2006-04-17
JP2006144890A JP4062711B2 (en) 2006-04-17 2006-05-25 Video encoding device

Related Child Applications (2)

Application Number Title Priority Date Filing Date
JP2007198211A Division JP4095664B2 (en) 2006-04-17 2007-07-30 Video encoding device
JP2007227228A Division JP4062712B2 (en) 2006-04-17 2007-09-01 Moving picture coding apparatus and moving picture coding method

Publications (2)

Publication Number Publication Date
JP2007312340A true JP2007312340A (en) 2007-11-29
JP4062711B2 JP4062711B2 (en) 2008-03-19

Family

ID=38667546

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006144890A Expired - Fee Related JP4062711B2 (en) 2006-04-17 2006-05-25 Video encoding device

Country Status (2)

Country Link
JP (1) JP4062711B2 (en)
WO (1) WO2007129433A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007295423A (en) * 2006-04-27 2007-11-08 Sony Corp Processing apparatus and method of image data, program for processing method of image data, and recording medium with program for processing method of image data recorded thereon
JP2008252346A (en) * 2007-03-29 2008-10-16 Canon Inc Image encoder and image encoding method
JP2009177356A (en) * 2008-01-22 2009-08-06 Canon Inc Image decoding apparatus and image decoding method
JP2009239565A (en) * 2008-03-27 2009-10-15 Renesas Technology Corp Image encoding device
JP2009267440A (en) * 2008-04-21 2009-11-12 Canon Inc Image encoding device and image encoding method
JP2013225889A (en) * 2008-06-03 2013-10-31 Microsoft Corp Adaptive quantization for enhancement layer video coding
JP2016146556A (en) * 2015-02-06 2016-08-12 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Image coding method, image decoding method, image coding device and image decoding device
WO2017126331A1 (en) * 2016-01-21 2017-07-27 ソニー株式会社 Image processing device and method
US9967561B2 (en) 2006-05-05 2018-05-08 Microsoft Technology Licensing, Llc Flexible quantization

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102017635B (en) * 2008-04-08 2013-05-15 日本电信电话株式会社 Video encoding method, video encoding equipment, video encoding program and its recording medium
US7876257B2 (en) * 2008-04-28 2011-01-25 Mitsubishi Electric Research Laboratories, Inc. Method and apparatus for compressing SAR signals
JP5389187B2 (en) 2009-10-29 2014-01-15 パナソニック株式会社 Image encoding method and image encoding apparatus
US10021409B2 (en) * 2012-05-09 2018-07-10 Integrated Device Technology, Inc. Apparatuses and methods for estimating bitstream bit counts
EP2814254A1 (en) 2013-02-21 2014-12-17 ST-Ericsson SA Combined parallel and pipelined video encoder
CN107613301B (en) * 2017-10-17 2020-05-26 苏州浪潮智能科技有限公司 Image processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0837662A (en) * 1994-07-22 1996-02-06 Hitachi Ltd Picture encoding/decoding device
JP2004135251A (en) * 2002-10-10 2004-04-30 Sony Corp Method of encoding image information, and method of decoding the image information
JP2005295526A (en) * 2004-03-11 2005-10-20 Matsushita Electric Ind Co Ltd Image encoding method, image encoding apparatus, and image encoding program
JP2006005438A (en) * 2004-06-15 2006-01-05 Sony Corp Image processor and method thereof
JP2006054877A (en) * 2004-08-05 2006-02-23 Samsung Electronics Co Ltd Adaptive arithmetic decoding method and apparatus thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0837662A (en) * 1994-07-22 1996-02-06 Hitachi Ltd Picture encoding/decoding device
JP2004135251A (en) * 2002-10-10 2004-04-30 Sony Corp Method of encoding image information, and method of decoding the image information
JP2005295526A (en) * 2004-03-11 2005-10-20 Matsushita Electric Ind Co Ltd Image encoding method, image encoding apparatus, and image encoding program
JP2006005438A (en) * 2004-06-15 2006-01-05 Sony Corp Image processor and method thereof
JP2006054877A (en) * 2004-08-05 2006-02-23 Samsung Electronics Co Ltd Adaptive arithmetic decoding method and apparatus thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HASSAN SHOJANIA AND SUBRAMANIA SUDHARSANAN: "A high performance CABAC encoder", THE 3RD INTERNATIONAL IEEE-NEWCAS CONFERENCE, 2005, JPN7007000059, 19 June 2005 (2005-06-19), pages 315 - 318, ISSN: 0000906173 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8279942B2 (en) 2006-04-27 2012-10-02 Sony Corporation Image data processing apparatus, image data processing method, program for image data processing method, and recording medium recording program for image data processing method
JP2007295423A (en) * 2006-04-27 2007-11-08 Sony Corp Processing apparatus and method of image data, program for processing method of image data, and recording medium with program for processing method of image data recorded thereon
US9967561B2 (en) 2006-05-05 2018-05-08 Microsoft Technology Licensing, Llc Flexible quantization
JP2008252346A (en) * 2007-03-29 2008-10-16 Canon Inc Image encoder and image encoding method
JP2009177356A (en) * 2008-01-22 2009-08-06 Canon Inc Image decoding apparatus and image decoding method
JP2009239565A (en) * 2008-03-27 2009-10-15 Renesas Technology Corp Image encoding device
JP2009267440A (en) * 2008-04-21 2009-11-12 Canon Inc Image encoding device and image encoding method
JP2013225889A (en) * 2008-06-03 2013-10-31 Microsoft Corp Adaptive quantization for enhancement layer video coding
US9185418B2 (en) 2008-06-03 2015-11-10 Microsoft Technology Licensing, Llc Adaptive quantization for enhancement layer video coding
US9571840B2 (en) 2008-06-03 2017-02-14 Microsoft Technology Licensing, Llc Adaptive quantization for enhancement layer video coding
US8897359B2 (en) 2008-06-03 2014-11-25 Microsoft Corporation Adaptive quantization for enhancement layer video coding
US10306227B2 (en) 2008-06-03 2019-05-28 Microsoft Technology Licensing, Llc Adaptive quantization for enhancement layer video coding
JP2016146556A (en) * 2015-02-06 2016-08-12 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Image coding method, image decoding method, image coding device and image decoding device
WO2017126331A1 (en) * 2016-01-21 2017-07-27 ソニー株式会社 Image processing device and method

Also Published As

Publication number Publication date
JP4062711B2 (en) 2008-03-19
WO2007129433A1 (en) 2007-11-15

Similar Documents

Publication Publication Date Title
JP4062711B2 (en) Video encoding device
TWI759389B (en) Low-complexity sign prediction for video coding
JP2007312427A (en) Dynamic image encoding device
JP4609670B2 (en) Image encoding apparatus, image encoding method and program thereof
JP5219089B2 (en) Image data generation method
JP5320254B2 (en) Adaptive frame / field coding at the macroblock level of digital video content
WO2011125211A1 (en) Image encoding method and image decoding method
JP5795525B2 (en) Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, and image decoding program
JP5520122B2 (en) Data converter
KR20140053050A (en) Methods of decision of candidate block on inter prediction and appratuses using the same
KR101974952B1 (en) Methods of coding intra prediction mode using two candidate intra prediction modes and apparatuses using the same
JP2006279573A (en) Encoder and encoding method, and decoder and decoding method
JP2023166555A (en) Image data encoding and decoding
US20070133689A1 (en) Low-cost motion estimation apparatus and method thereof
JP2017513437A (en) Data encoding and decoding
KR101802375B1 (en) Methods of derivation of temporal motion vector predictor and appratuses using the same
JP5219062B2 (en) Image data generation method
JP5447239B2 (en) Moving picture coding apparatus and moving picture coding method
US20150030069A1 (en) Neighbor management for use in entropy encoding and methods for use therewith
JP4062712B2 (en) Moving picture coding apparatus and moving picture coding method
WO2017082304A1 (en) Information compression device, information compression method, recording medium, and encoding device
JP5844969B2 (en) Image decoding module, image encoding device, image decoding device, image decoding method, and program
JP5709492B2 (en) Image coding method conversion apparatus and image coding method conversion program
CN111164975A (en) Image data encoding and decoding
TWI486908B (en) Method and associated apparatus for video encoding

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070901

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070901

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20070901

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20070925

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071011

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071014

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071222

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees