JP2010252394A - Image coding apparatus, image coding method, and image editing apparatus - Google Patents

Image coding apparatus, image coding method, and image editing apparatus Download PDF

Info

Publication number
JP2010252394A
JP2010252394A JP2010166173A JP2010166173A JP2010252394A JP 2010252394 A JP2010252394 A JP 2010252394A JP 2010166173 A JP2010166173 A JP 2010166173A JP 2010166173 A JP2010166173 A JP 2010166173A JP 2010252394 A JP2010252394 A JP 2010252394A
Authority
JP
Japan
Prior art keywords
picture
encoding
editing
stream
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2010166173A
Other languages
Japanese (ja)
Inventor
Tomoyuki Okuyama
智之 奥山
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2010166173A priority Critical patent/JP2010252394A/en
Publication of JP2010252394A publication Critical patent/JP2010252394A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To align phases of pictures in a coded stream before and after editing in order to suppress deterioration of the quality of re-encoded pictures even when the coded stream is edited at an arbitrary picture position. <P>SOLUTION: The image coding apparatus includes: a coding processing section which outputs coded data obtained by coding inputted frames; and a decoding processing section which decodes the coded data and outputs the decoded data including respective frames to be reproduced. The decoding processing section outputs the decoded data having been subjected to the editing, in which the frames corresponding to the editing are inserted in the respective frames to be reproduced included in the decoded data, when the editing of modifying reproduction modes of the respective frames to be reproduced included in the decoded data is carried out. The coding processing section codes the decoded data having been subjected to the editing in such a way that respective inputted frames and frames corresponding to the respective inputted frames included in the decoded data having been subjected to the editing are coded in the same picture type. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、非圧縮の映像データを符号化した符号化ストリームを編集し、復号し、再符号化することができる画像符号化装置、画像符号化方法及び画像編集装置に関する。   The present invention relates to an image encoding device, an image encoding method, and an image editing device that can edit, decode, and re-encode an encoded stream obtained by encoding uncompressed video data.

近年のディジタル技術の発展に伴い、HDD(Hard Disc Drive)若しくはDVD(Digital Versatile Disc)レコーダやDVDプレーヤのようなディジタル方式の音声/画像記録再生装置が実用化されている。このようなディジタル方式では、画像データは MPEG(Moving Picture Experts Group)方式で圧縮しストリーム化されている   With the recent development of digital technology, digital audio / video recording / reproducing apparatuses such as HDD (Hard Disc Drive) or DVD (Digital Versatile Disc) recorders and DVD players have been put into practical use. In such a digital system, the image data is compressed and streamed by the MPEG (Moving Picture Experts Group) system.

MPEG2方式(ISO/IEC13818−2)は、フレーム内符号化画像(以下Iピクチャ:intra coded picture)、片方向予測によりフレーム間符号化された画像(以下Pピクチャ:predictive coded picture)、及び双方向予測によりフレーム間符号化された画像(以下Bピクチャ:bi-directionally predictive coded picture)により符号化ストリームが形成されている。   The MPEG2 system (ISO / IEC13818-2) is an intra-frame coded image (hereinafter I picture: intra coded picture), an image that is inter-frame coded by unidirectional prediction (hereinafter P picture: predictive coded picture), and bidirectional. A coded stream is formed by an image (hereinafter referred to as B picture: bi-directionally predictive coded picture) that has been inter-frame coded by prediction.

MPEG2方式のビデオストリームはGOP(group of pictures)という単位で符号化されている。1つのGOPは、通常15枚程度のピクチャから構成され、Iピクチャから始まり、Pピクチャ又はBピクチャが含まれる。   An MPEG-2 video stream is encoded in units of GOP (group of pictures). One GOP is usually composed of about 15 pictures, starts from an I picture, and includes a P picture or a B picture.

Iピクチャは画像内符号化により作られるもので、前画像からの予測符号化を行わない、すなわち、他の画像を参照せずにピクチャ内符号化を行なうものであ り、復号に必要な全ての情報を有する画像である。Pピクチャは時間的に前のIピクチャ又はPピクチャを参照してピクチャ間予測符号化を行なうピクチャであ り、したがって、ストリーム順で先行する既に復号されたIピクチャ又はPピクチャの情報が必要な画像である。Bピクチャは、前後(過去及び未来)の2枚の Iピクチャ又はPピクチャを使用し、双方向からの予測符号化を行うピクチャであり、復号には、ストリーム順で先行する既に復号化されたIピクチャ又はPピ クチャ2画像の情報が必要な画像である。   An I picture is created by intra-picture coding, and does not perform predictive coding from the previous picture, that is, performs intra-picture coding without referring to other pictures. It is an image having the information. A P picture is a picture that performs inter-picture predictive coding with reference to a temporally previous I picture or P picture. Therefore, information on an already decoded I picture or P picture that precedes in the stream order is required. It is an image. A B picture is a picture that uses two I pictures or P pictures before and after (past and future) and performs predictive coding in both directions. This is an image that requires information of I picture or P picture 2 image.

したがって、Bピクチャが存在する場合には、符号画像順と表示画像順は一致しない。すなわち、Bピクチャの復号には該画像よりも再生順で後に表示される 画像を参照するため、符号順ではBピクチャよりも先にその参照画像となるIピクチャ又はPピクチャが配置される。したがって、このようなMPEG2方式で 得られたビデオストリームを編集する際には、Pピクチャ及びBピクチャに符号化された画像の参照画像が編集により変わってしまうため、必要なピクチャの データを抜き出して単純に連結することができない。   Therefore, when a B picture exists, the code image order does not match the display image order. That is, when decoding a B picture, an image that is displayed later in the playback order than that image is referred to, and therefore an I picture or P picture that is the reference image is arranged before the B picture in the code order. Therefore, when editing a video stream obtained by such an MPEG2 system, the reference picture of an image encoded into a P picture and a B picture changes due to editing. Therefore, necessary picture data is extracted. It cannot simply be connected.

そこで、MPEG方式で符号化された動画像の編集を行なう際には、簡単には、GOP単位で編集することが考えられる。しかしながら、GOPの途中にシー チェンジがある場合に、その点で編集を行なうことができないという問題点がある。そこで、GOPの途中にある編集点と、GOPの途中にある編集点とを連結 するビデオストリームの編集方法が特許文献1に記載されている。   Therefore, when editing a moving image encoded by the MPEG method, it is conceivable to edit in units of GOPs. However, if there is a change in the middle of a GOP, there is a problem that editing cannot be performed at that point. Therefore, Patent Document 1 describes a video stream editing method that connects an editing point in the middle of a GOP and an editing point in the middle of a GOP.

この特許文献1に記載の編集方法においては、フレーム間予測符号化された第1のビデオストリームの一部又は全部と第2のビデオストリームの一部又は全部 を連結して連続再生可能なビデオストリームを得る。この場合、第1のビデオストリームから、フレーム内予測符号化または片方向のフレーム間予測により符号 化されたピクチャの直前までの、第1の部分ビデオストリームを切り出す。そして、第2のビデオストリームから、フレーム内符号化または片方向のフレーム間 予測により符号化されたピクチャ以降の、第2の部分ビデオストリームを切り出す。第2のビデオストリームから切り出された第2の部分ストリームの直前に表 示されるピクチャがフレーム内符号化されたピクチャであるか否かを判定し、フレーム内符号化されたピクチャであると判定された場合には、このピクチャを第 1のフレーム内符号化ピクチャとし、フレーム内符号化されたピクチャでないと判定された場合には、該ピクチャの直前にあるフレーム内符号化ピクチャから該 ピクチャまでの片方向フレーム間予測符号化ピクチャを順に復号化することで該ピクチャの復号画像を得た後、復号された該ピクチャをフレーム内符号化処理に より再符号化し、第1のビデオストリームから得られた第1の部分ストリームと、第2のビデオストリームから得られた第2の部分ストリームとの間に、再符号 化したフレーム内符号化ピクチャを挿入することで、GOPの途中に編集点がある場合においても編集を可能としている。   In the editing method described in Patent Document 1, a video stream that can be continuously played by linking a part or all of the first video stream subjected to interframe prediction encoding and a part or all of the second video stream. Get. In this case, the first partial video stream is cut out from the first video stream up to immediately before the picture encoded by intraframe prediction encoding or one-way interframe prediction. Then, from the second video stream, the second partial video stream after the picture encoded by intra-frame encoding or unidirectional inter-frame prediction is cut out. It is determined whether or not the picture displayed immediately before the second partial stream cut out from the second video stream is an intra-frame encoded picture, and is determined to be an intra-frame encoded picture. If this picture is the first intra-frame coded picture, and it is determined that the picture is not an intra-frame coded picture, the picture from the intra-frame coded picture immediately before the picture to the picture is determined. A decoded image of the picture is obtained by sequentially decoding the unidirectional inter-frame prediction coded pictures, and then the decoded picture is re-encoded by intra-frame coding processing and obtained from the first video stream. Between the first partial stream and the second partial stream obtained from the second video stream. By inserting the reduction picture, thereby enabling editing even when there is a splicing point in the middle of the GOP.

しかしながら、このような符号化されたままのストリームを編集する場合には、ストリームの一部を削除することで全体の符号量を小さくすることはできるものの、符号化の際のビットレートを変更することができず、編集後における符号量を調整することが難しい。   However, when editing such an encoded stream, the entire code amount can be reduced by deleting a part of the stream, but the bit rate at the time of encoding is changed. It is difficult to adjust the code amount after editing.

例えば、非圧縮のディジタル映像データを、MPEG等の方法によりIピクチャ、Bピクチャ及びPピクチャから構成されるGOP単位に圧縮符号化して光磁 気ディスク(MOディスク;magneto-optical disc)等の記録媒体に記録する際には、圧縮符号化後の圧縮映像データのデータ量(ビット量)を、伸長復号後の映像の品質を高く保ちつつ記録媒体の記録 容量以下、あるいは、通信回線の伝送容量以下にする必要がある。   For example, uncompressed digital video data is compressed and encoded into GOP units composed of I-pictures, B-pictures, and P-pictures by a method such as MPEG, and recorded on a magneto-optical disc (MO disc). When recording on a medium, the data amount (bit amount) of the compressed video data after compression encoding is equal to or less than the recording capacity of the recording medium while maintaining high quality of the video after decompression decoding, or the transmission capacity of the communication line. Must be:

このため、事前解析を用いた動画像の符号化方法が採用される場合がある。事前解析を用いた符号化方法においては、先ず、1パス目で非圧縮映像データを予 備的に圧縮符号化して圧縮符号化後のデータ量を見積もり、次の2パス目に、見積もったデータ量に基づいて圧縮率を調節し、圧縮符号化後のデータ量が記録媒 体の記録容量以下になるように圧縮符号化する(以下、このような圧縮符号化方法を2パス・エンコードともいう)。   For this reason, a moving image encoding method using prior analysis may be employed. In the encoding method using the pre-analysis, first, the uncompressed video data is preliminarily compressed and encoded in the first pass to estimate the amount of data after compression encoding, and the estimated data in the next second pass. The compression rate is adjusted based on the amount, and compression encoding is performed so that the amount of data after compression encoding is equal to or less than the recording capacity of the recording medium (hereinafter, such compression encoding method is also referred to as two-pass encoding). ).

この2パス・エンコードにおいては、符号量の割当てによるバッファ占有量の推移を考慮しなければ実際の符号化処理の際に、バッファでオーバーフローやア ンダーフローなどのバッファの破綻を引き起こす。仮に、実際の符号化処理の際に、バッファの破綻を回避する処理が組み込まれていたとしても、画像を符号化 する際に発生する符号量が割当てられた目標符号量から外れたものになり、発生後の符号量制御が正確にできなくなる。この場合には、本来、割当てるべき符号 量と異なった符号量を画像に割当ててしまうこととなり、符号化における画質の劣化を引き起してしまう。   In this two-pass encoding, if the transition of the buffer occupancy due to the allocation of the code amount is not taken into account, the buffer will cause a buffer failure such as overflow or underflow in the actual encoding process. Even if a process for avoiding buffer failure is incorporated in the actual encoding process, the code amount generated when the image is encoded deviates from the assigned target code amount. Therefore, the code amount control after generation cannot be performed accurately. In this case, a code amount that is different from the code amount that should be assigned is assigned to an image, which causes deterioration of image quality in encoding.

そこで、特許文献2には、入力画像を符号化する前に画像の解析を行い、画像毎の複雑度を算出し、この複雑度に応じた符号量を一定区間内の画像に一括して 割当て、符号量がバッファに占める占有量の推移を見積ることでバッファの破綻を回避し、与えられたビットレートとバッファサイズとに基づいて適切な符号配 分を行うことにより符号化した画像の画質を向上させる事前解析を用いた動画像符号化装置が開示されている。   Therefore, in Patent Document 2, an image is analyzed before encoding an input image, a complexity for each image is calculated, and a code amount corresponding to the complexity is collectively allocated to images within a certain section. Therefore, by estimating the change in the amount of code occupied by the buffer, it is possible to avoid buffer failure, and by performing appropriate code allocation based on the given bit rate and buffer size, the image quality of the encoded image can be reduced. A moving picture coding apparatus using a prior analysis to improve is disclosed.

特開2002−300528号公報Japanese Patent Laid-Open No. 2002-300528 特開2002−232882号公報JP 2002-232882 A

しかしながら、上記特許文献2に記載の2パス・エンコード方法の場合、1パス目でエンコードしたストリームをピクチャ単位で編集すると、編集したスト リームを復号して再度符号化したときには編集点以後のピクチャ位相を1パス目の符号化ストリームのピクチャ位相と一致させることができない。この場合、例 えば元々Bピクチャとして符号化されていたピクチャをIピクチャとして符号化する場合などが生じ、編集後の画像が劣化してしまう場合がある。更には、編集 したストリームのピクチャ位相が、事前解析済みの1パス目の符号化ストリームのピクチャ位相と一致しなくなることから、編集点以降の複雑度を参照できなく なり、編集したストリームを2パス・エンコードすることができなくなってしまう。   However, in the case of the two-pass encoding method described in Patent Document 2, if the stream encoded in the first pass is edited on a picture-by-picture basis, the picture phase after the edit point is decoded when the edited stream is decoded and re-encoded. Cannot match the picture phase of the encoded stream of the first pass. In this case, for example, a picture originally encoded as a B picture may be encoded as an I picture, and the edited image may deteriorate. Furthermore, since the picture phase of the edited stream does not match the picture phase of the first-pass encoded stream that has been analyzed in advance, it becomes impossible to refer to the complexity after the edit point, and the edited stream has two passes.・ Encoding becomes impossible.

本発明にかかる画像符号化装置は、非圧縮の映像データを符号化した符号化ストリームを編集する画像符号化装置であって、前記符号化ストリームを1又は複 数の編集点で編集されるよう編集指示を作成する編集部と、前記編集指示に従って前記符号化ストリームを復号して編集済ストリームを生成する復号処理部と、 前記編集済みストリームを再符号化して編集済符号化ストリームを生成する符号化処理部とを有し、前記符号化処理部は、前記符号化ストリームと同一フレーム においては同一のピクチャタイプになるようピクチャ位相を揃えて前記編集済符号化ストリームを生成するものである。   An image encoding device according to the present invention is an image encoding device that edits an encoded stream obtained by encoding uncompressed video data, and the encoded stream is edited at one or a plurality of editing points. An editing unit for creating an editing instruction; a decoding processing unit for decoding the encoded stream according to the editing instruction to generate an edited stream; and a code for re-encoding the edited stream to generate an edited encoded stream An encoding processing unit, and the encoding processing unit generates the edited encoded stream by aligning picture phases so that the same picture type is obtained in the same frame as the encoded stream.

本発明においては、非圧縮の映像データを符号化した符号化ストリームを編集して再度符号化する際、元の符号化ストリームと同一フレームにおいては同一ピ クチャとなるよう、ピクチャ位相を揃えて再符号化することができるため、例えば元々BピクチャだったものをIピクチャに符号化するようなことがなく、画質 の劣化を防止することができる。   In the present invention, when an encoded stream obtained by encoding uncompressed video data is edited and re-encoded, the picture phase is aligned and re-encoded so that the same picture is obtained in the same frame as the original encoded stream. Since encoding is possible, for example, what was originally a B picture is not encoded into an I picture, and deterioration in image quality can be prevented.

本発明にかかる画像編集装置は、非圧縮の映像データを符号化した符号化ストリームを編集する画像符号化処理部と、符号化ストリームを記録する2以上の記 録部とを備え、前記画像符号化処理部は、一方の記憶装置に記録された前記符号化ストリームを1又は複数の編集点で編集されるよう編集指示を生成する編集部 と、前記編集指示に従って前記符号化ストリームを復号して編集済ストリームを生成する復号処理部と、前記編集済みストリームを再符号化して編集済符号化ス トリームを生成する符号化処理部とを有し、前記符号化処理部は、前記符号化ストリームと同一フレームにおいては同一のピクチャタイプになるようピクチャ位 相を揃えて前記編集済符号化ストリームを生成し、前記他方の記憶装置は、前記編集済符号化ストリームを記録するものである。   An image editing apparatus according to the present invention includes: an image encoding processing unit that edits an encoded stream obtained by encoding uncompressed video data; and two or more recording units that record the encoded stream. An encoding processing unit that generates an editing instruction so that the encoded stream recorded in one storage device is edited at one or a plurality of editing points; and decoding the encoded stream according to the editing instruction A decoding processing unit that generates an edited stream; and an encoding processing unit that re-encodes the edited stream to generate an edited encoded stream, and the encoding processing unit includes the encoded stream and The edited encoded stream is generated by aligning picture phases so that the same picture type is obtained in the same frame, and the other storage device stores the edited encoded stream. Recording the program.

本発明においては、一方の記憶装置に記録された元の符号化ストリームから編集したデータを、元の符号化ストリームと同一フレームにおいては同一ピクチャ となるよう、ピクチャ位相を揃えて再符号化するので、画質を劣化させることなくこれを他方の記憶装置にダビングすることができる。また、符号化ストリーム と同一フレームにおいては同一のピクチャタイプになるようピクチャ位相を揃えて編集済みストリームを符号化するので、元の符号化ストリームを生成する際に 各フレームの複雑度を解析しておけば、編集済みストリームの2パス・エンコードが可能になる。   In the present invention, data edited from the original encoded stream recorded in one storage device is re-encoded with the same picture phase so that the same picture is obtained in the same frame as the original encoded stream. This can be dubbed to the other storage device without degrading the image quality. Also, since the edited stream is encoded with the same picture phase in the same frame as the encoded stream, the complexity of each frame is analyzed when the original encoded stream is generated. This will allow two-pass encoding of the edited stream.

本発明によれば、符号化ストリームの任意のピクチャ位置で編集しても、編集後に符号化して得られる符号化ストリームと編集前の符号化ストリームのピク チャ位相を揃えることができ、再符号化した画質の劣化を抑制することができる。そして、本発明によれば、符号化ストリームを編集しても編集前の符号化スト リームと同一のピクチャ位相とすることができるので、符号化ストリームについて予め事前解析を行なっておけば、編集後であっても2パス・エンコードを行な うことができる。   According to the present invention, even if editing is performed at an arbitrary picture position of the encoded stream, the picture phase of the encoded stream obtained by encoding after editing and the encoded stream before editing can be aligned, and re-encoding can be performed. It is possible to suppress degradation of the image quality. According to the present invention, even if the encoded stream is edited, the same picture phase as that of the pre-edited encoded stream can be obtained. Even so, 2-pass encoding can be performed.

本発明の実施の形態にかかる画像符号化装置を示すブロック図である。It is a block diagram which shows the image coding apparatus concerning embodiment of this invention. 本発明の実施の形態にかかる画像符号化装置の符号化処理部の詳細を示すブロック図である。It is a block diagram which shows the detail of the encoding process part of the image coding apparatus concerning embodiment of this invention. 本発明の実施の形態にかかる画像符号化装置の復号処理部の詳細を示すブロック図である。It is a block diagram which shows the detail of the decoding process part of the image coding apparatus concerning embodiment of this invention. 本発明の実施の形態にかかる画像符号化装置におけるオリジナルストリームの編集方法を示す図であって、(a)はオリジナルストリームを示す図、(b) は、編集点を含むオリジナルストリームのGOPを抜き出して示す図、(c)は、編集後のプレイリストの一部を示す図である。2A and 2B are diagrams illustrating an original stream editing method in the image encoding apparatus according to the embodiment of the present invention, in which FIG. 1A is a diagram illustrating the original stream, and FIG. 2B is a GOP extracted from the original stream including the editing point; (C) is a diagram showing a part of the edited playlist. 本発明の実施の形態にかかる画像符号化装置における編集済みストリームを生成する方法を説明する図であって、(a)は、再符号化ピクチャ群に含まれるピクチャ総数(n+(N−m+1))<Nの場合、(b)は、n+(N−m+1)>Nの場合を説明する図である。It is a figure explaining the method to produce | generate the edited stream in the image coding apparatus concerning embodiment of this invention, Comprising: (a) is the total number of pictures (n + (N-m + 1) contained in a re-encoded picture group. ) <N, (b) is a diagram illustrating the case of n + (N−m + 1)> N. 本発明の実施の形態にかかる画像符号化装置における編集済みストリームを生成する方法を説明する図であって、(a)は、再符号化ピクチャ群に含まれるピクチャ総数(n+(N−m+1))=2Nの場合、(b)は、n+(N−m+1)=Nの場合を説明する図である。It is a figure explaining the method to produce | generate the edited stream in the image coding apparatus concerning embodiment of this invention, Comprising: (a) is the total number of pictures (n + (N-m + 1) contained in a re-encoded picture group. ) = 2N, (b) is a diagram illustrating a case where n + (N−m + 1) = N. 本発明の実施の形態にかかる画像符号化装置における編集済みストリームを生成する方法を説明する図であって、(a)は、編集点Bが先頭GOPに位置する場合、(b)は、編集点Aが最終GOPに位置する場合を説明する図である。FIG. 7 is a diagram for explaining a method of generating an edited stream in the image encoding device according to the embodiment of the present invention, where (a) is an edit point B located at the first GOP, and (b) is an edit It is a figure explaining the case where the point A is located in the last GOP. 本発明の実施の形態にかかる画像符号化装置における2パス目のエンコード方法を示すフローチャートである。It is a flowchart which shows the encoding method of the 2nd pass in the image coding apparatus concerning embodiment of this invention. 同じく、本発明の実施の形態にかかる画像符号化装置における2パス目のエンコード方法を示すフローチャートである。Similarly, it is a flowchart showing a second pass encoding method in the image encoding device according to the embodiment of the present invention. 編集済みストリームにおいて、複雑度を用いて目標符号量を算出する方法を示すフローチャートである。It is a flowchart which shows the method of calculating the target code amount using complexity in the edited stream. 同じく、編集済みストリームにおいて、複雑度を用いて目標符号量を算出する方法を示すフローチャートである。Similarly, it is a flowchart illustrating a method for calculating a target code amount using complexity in an edited stream. 編集済みストリームにおいて、ピクチャ位相を揃えるために挿入するフレームの複雑度を算出する方法を示すフローチャートである。It is a flowchart which shows the method of calculating the complexity of the frame inserted in order to arrange a picture phase in an edited stream.

以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。この実施の形態は、本発明を、2パス・エンコード方法を用いた編集機能付き動画像符号化装置に適用したものである。
本実施の形態にかかる画像符号化装置は、2パス・エンコード機能を有する。2パス・エンコードは、非圧縮オーディオ/ビデオデータを予備的に圧縮符号化 して圧縮符号化後のデータ量を見積もり(1パス目)、次に、見積もったデータ量に基づいて圧縮率を調節し、圧縮符号化後のデータ量が記録媒体の記録容量以 下になるように圧縮符号化する(2パス目)方法である。このため、1パス目において、非圧縮の映像データなどのタイトルを例えばMPEG符号化して記録す る際に各フレームを解析してその複雑度を求め(事前解析)、この複雑度を、MPEG符号化したタイトルと共に記録しておく。そして、2パス目に、予め定め られるビットレートとなるよう、上記複雑度に応じて符号量を割り当て符号化する。複雑度を用いて符号量を割り当てることで、限られたビットレートにおける 画質の向上を図り、バッファのアンダーフローやオーバーフローを防止することができる。
Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In this embodiment, the present invention is applied to a moving image encoding apparatus with an editing function using a two-pass encoding method.
The image encoding apparatus according to the present embodiment has a two-pass encoding function. In 2-pass encoding, uncompressed audio / video data is preliminarily compressed and encoded to estimate the amount of data after compression encoding (first pass), and then the compression rate is adjusted based on the estimated amount of data In this method, compression encoding is performed so that the amount of data after compression encoding is less than the recording capacity of the recording medium (second pass). Therefore, in the first pass, when a title such as uncompressed video data is recorded by MPEG encoding, for example, each frame is analyzed to determine its complexity (preliminary analysis). Record along with the converted title. Then, in the second pass, a code amount is allocated and encoded according to the complexity so as to obtain a predetermined bit rate. By assigning the code amount using the complexity, it is possible to improve the image quality at a limited bit rate and prevent underflow and overflow of the buffer.

そして、本実施の形態における画像符号化装置は、MPEG符号化された記録済みのタイトル(番組)をピクチャ単位で編集したプレイリスト又は編集済みタイトルを生成しても、上記2パス・エンコードを可能にするものである。   The image encoding apparatus according to the present embodiment can perform the above-mentioned two-pass encoding even when generating a playlist or an edited title in which an MPEG-coded recorded title (program) is edited in units of pictures. It is to make.

通常、事前解析された符号化ストリームは、各フレーム毎の複雑度が求められているが、各フレームは所定のピクチャタイプに符号化されており、複雑度もピ クチャタイプに対応したものとなっている。したがって、符号化ストリームをGOPの途中で編集して復号してしまうと、再び編集後のタイトルを符号化する場 合、編集前の符号化ストリームと対応するフレームが同じピクチャタイプに符号化されなくなる。すなわち、もともと例えばBピクチャで符号化されていたフ レームがIピクチャで符号化される場合などが生じ、編集後の符号化ストリームにおいては画質が劣化する場合がある。   Usually, the pre-analyzed encoded stream requires complexity for each frame, but each frame is encoded to a predetermined picture type, and the complexity also corresponds to the picture type. ing. Therefore, if the encoded stream is edited and decoded in the middle of a GOP, when the title after editing is encoded again, the frame corresponding to the encoded stream before editing is not encoded to the same picture type. . In other words, for example, a frame that was originally encoded with a B picture may be encoded with an I picture, and the image quality may be degraded in the encoded stream after editing.

更に編集後の符号化ストリームが、編集前の事前解析された符号化ストリームとは対応するフレーム(同一画像)が異なるピクチャタイプのピクチャに符号化 されると、事前解析結果を用いて最適な目標符号量を設定して符号化する2パス・エンコードが不可能になる。これに対し、本実施の形態にかかる画像符号化装 置は、編集後の符号化ストリームにおいて、所定の画像(以下、挿入画像という。)を挿入することにより、編集前の事前解析済みの符号化ストリームと対応す るフレームが同一ピクチャタイプのピクチャに符号化されるようピクチャ位相を揃えるものである。すなわち、ピクチャ位相を揃えるとは、一旦符号化した符号 化ストリームの構成ピクチャを、復号し再符号化する際において当該構成ピクチャのピクチャタイプと同一のピクチャタイプになるよう、ピクチャタイプを一致 させて符号化することを示す。ピクチャ位相を揃えることにより、事前解析された符号化ストリームにおいて、GOPの途中に編集点を設けて編集し再符号化す る場合であっても編集前の符号化ストリームの事前解析結果を参照することができ、2パス・エンコードを可能にする。   Furthermore, when the encoded stream after editing is encoded into a picture of a different picture type in the frame (same image) corresponding to the pre-analyzed encoded stream before editing, the optimal target is determined using the pre-analysis result. Two-pass encoding in which the code amount is set and encoded becomes impossible. On the other hand, the image coding apparatus according to the present embodiment inserts a predetermined image (hereinafter referred to as an inserted image) into the coded stream after editing, so that the pre-analyzed coding before editing is performed. The picture phase is aligned so that the frame corresponding to the stream is encoded into a picture of the same picture type. In other words, aligning the picture phase means matching the picture type so that the constituent picture of the encoded stream once encoded becomes the same picture type as that of the constituent picture when it is decoded and re-encoded. Indicates encoding. Refer to the pre-analysis result of the pre-edited encoded stream even if the pre-analyzed encoded stream is edited and re-encoded with the edit point in the GOP by aligning the picture phase. And allows two-pass encoding.

ここでは、先ず、本実施の形態にかかる画像符号化装置の構成について説明し、次に、編集後のMPEGストリーム(以下、編集済符号化ストリームST1と いう。)を編集前のMPRGストリーム(以下、オリジナルストリームST0という。)のピクチャ位相に合わせる方法について説明し、最後にオリジナルスト リームの事前解析結果を用いた編集済みストリームの2パス・エンコード方法について説明する。   Here, the configuration of the image encoding apparatus according to the present embodiment will be described first, and then the edited MPEG stream (hereinafter referred to as the edited encoded stream ST1) is converted into the MPRG stream (hereinafter referred to as the edited encoded stream ST1). The method of matching the picture phase of the original stream ST0) will be described, and finally, the two-pass encoding method of the edited stream using the pre-analysis result of the original stream will be described.

図1は、本実施の形態にかかる画像符号化装置を示すブロック図である。画像符号化装置1は、符号化処理部2、編集部3、復号処理部4、表示部5、及びス トレージインターフェース(I/F)6、7を有する。なお、表示部5は、画像符号化装置1とは異なる装置であってもよい。また、ストレージI/Fは本実施 の形態においては、2つとして説明するが、2以上あってもよいことは勿論である。ストレージI/F6は、例えばHDD等の記憶装置30と接続され、スト レージI/F7は例えばDVDレコーダ等の記憶装置40と接続される。また、これら記憶装置30、40が画像符号化装置に含まれる構成としてもよい。   FIG. 1 is a block diagram showing an image encoding apparatus according to the present embodiment. The image encoding device 1 includes an encoding processing unit 2, an editing unit 3, a decoding processing unit 4, a display unit 5, and storage interfaces (I / F) 6 and 7. The display unit 5 may be a device different from the image encoding device 1. In this embodiment, the storage I / F is described as two, but it goes without saying that there may be two or more storage I / Fs. The storage I / F 6 is connected to a storage device 30 such as an HDD, and the storage I / F 7 is connected to a storage device 40 such as a DVD recorder. The storage devices 30 and 40 may be included in the image encoding device.

本実施の形態にかかる画像符号化装置1は、符号化処理部2により、入力される非圧縮の映像データを、MPEG符号化して記憶装置30、40に記録した り、編集部3により、記憶装置30、40に記録された符号化ストリームを編集したりする。また、復号処理部4により符号化ストリームを復号して表示部5に て表示(再生)する。ここで、本画像符号化装置1は、上述したように、映像データを符号化処理部2にて符号化した符号化ストリーム(以下、オリジナルスト リームという。)を編集して編集済符号化ストリームST1を生成する場合に、オリジナルストリームST0と編集済符号化ストリームST1のピクチャ位相を 揃える機能を有する。すなわち、オリジナルストリームST0において、例えばIピクチャに符号化されたフレームは編集済みストリームにおいてもIピクチャ に符号化される。   In the image encoding apparatus 1 according to the present embodiment, the input non-compressed video data is MPEG encoded by the encoding processing unit 2 and recorded in the storage devices 30 and 40, or stored by the editing unit 3. The encoded stream recorded in the devices 30 and 40 is edited. Further, the encoded stream is decoded by the decoding processing unit 4 and displayed (reproduced) on the display unit 5. Here, as described above, the present image encoding apparatus 1 edits an encoded stream obtained by encoding video data by the encoding processing unit 2 (hereinafter referred to as an original stream), and an edited encoded stream. When generating ST1, it has a function of aligning the picture phases of the original stream ST0 and the edited encoded stream ST1. That is, in the original stream ST0, for example, a frame encoded into an I picture is also encoded into an I picture in the edited stream.

このことにより、オリジナルストリームST0を生成する際にその複雑度を解析し、オリジナルストリームST0と共に保存しておけば、編集済みストリーム ST1を生成する際に、その複雑度を参照することができる。したがって、この複雑度に応じた最適な符号量を割り当てることができる。すなわち、編集済み符 号化ストリームST1を生成する際の符号量を制御しつつ符号化する2パス・エンコードを可能とする。これにより、オリジナルストリームの符号化時よりビッ トレートを小さくしても画質の劣化を抑制し、例えばDVD等の記憶容量が限られたメディアに記録することができる。   Thus, when the original stream ST0 is generated, its complexity is analyzed, and if it is stored together with the original stream ST0, the complexity can be referred to when the edited stream ST1 is generated. Therefore, an optimal code amount according to the complexity can be assigned. That is, it is possible to perform two-pass encoding in which encoding is performed while controlling the amount of code when the edited encoded stream ST1 is generated. As a result, even if the bit rate is made smaller than that at the time of encoding the original stream, the deterioration of the image quality can be suppressed, and recording can be performed on a medium with limited storage capacity such as a DVD.

以下、各ブロックについて詳細に説明する。図2は、符号化処理部の詳細を示すブロック図である。符号化処理部2は、図2に示すように、外部から供給され る非圧縮の映像データ又は復号処理部4からの復号データが入力され、これをMPEG符号化する符号化部21及び符号化したデータを一時保存する符号化バッ ファ22を有する。また、符号化の際の各種情報を解析して複雑度を算出する解析部23を有する。更に、複雑度に基づき各ピクチャの目標符号量を割り当てる 符号量割り当て部24を有し、これにより2パス・エンコードを可能にする。更にまた、図示せぬ制御部から指定される符号量又は符号量割り当て部24にて割 り当てられた符号量で符号化するよう符号化部21を制御する符号量制御部25を有する。更に、2パス・エンコードの際、編集前後のピクチャ位相を一致させ るために、符号化処理の一時停止、再開のタイミングを制御するポーズ/レジューム制御部26を有する。   Hereinafter, each block will be described in detail. FIG. 2 is a block diagram illustrating details of the encoding processing unit. As shown in FIG. 2, the encoding processing unit 2 is supplied with uncompressed video data supplied from outside or decoded data from the decoding processing unit 4, and encodes this into an encoding unit 21 and an encoding unit. It has an encoding buffer 22 for temporarily storing the data. In addition, an analysis unit 23 that analyzes various information at the time of encoding and calculates complexity is provided. Furthermore, a code amount assigning unit 24 for assigning a target code amount of each picture based on the complexity is provided, thereby enabling two-pass encoding. Furthermore, a code amount control unit 25 that controls the encoding unit 21 to perform encoding with the code amount specified by the control unit (not shown) or the code amount assigned by the code amount allocation unit 24 is provided. Furthermore, in order to make the picture phases before and after editing coincide with each other in the case of two-pass encoding, a pause / resume control unit 26 that controls the timing of pause and restart of the encoding process is provided.

符号化処理部2は、通常、タイトルを記録する場合には、入力される非圧縮の映像データから例えば比較的高いビットレートでMPEG符号化し、符号化した ストリーム(オリジナルストリーム)をストレージI/F6を介して例えばHDD等の記憶容量が大きい記憶装置30に記憶する。そのとき解析部23は、上記 映像データの各フレームを所定のピクチャに符号化する際に発生する符号量や量子化スケールに基づき複雑度Xを解析する。この複雑度Xは、各フレームを所定 のピクチャタイプのピクチャに符号化する際の複雑度を示すものであって、各ピクチャに対応付けられたものとなっている。この複雑度Xは、オリジナルスト リームと共に記憶装置30に記憶される。なお、複雑度Xは、記憶装置30ではなく、その他、装置内に設けられたメモリ(図示せず)等に記録するようにして もよい。   Normally, when recording a title, the encoding processing unit 2 MPEG-encodes the input uncompressed video data at, for example, a relatively high bit rate, and converts the encoded stream (original stream) to the storage I / F 6. Are stored in the storage device 30 having a large storage capacity such as an HDD. At that time, the analysis unit 23 analyzes the complexity X based on a code amount and a quantization scale generated when each frame of the video data is encoded into a predetermined picture. This complexity X indicates the complexity when each frame is encoded into a picture of a predetermined picture type, and is associated with each picture. This complexity X is stored in the storage device 30 together with the original stream. The complexity level X may be recorded not in the storage device 30 but in a memory (not shown) or the like provided in the device.

解析部23は、特徴量観測部51及び複雑度算出部52を有する。特徴量観測部51は、1パス目の符号化の際に、特徴量としての画像の発生符号量と平均量 子化スケールとを観測する。例えば、符号化部21が符号量制御部25の制御のもと、指定のビットレートRに基づいて非圧縮映像データからなるタイトルを符 号化する際の各フレームfの発生符号量S[f]と平均量子化スケールQ[f]とを観測する。   The analysis unit 23 includes a feature amount observation unit 51 and a complexity calculation unit 52. The feature quantity observation unit 51 observes the generated code quantity and average quantization scale of the image as the feature quantity at the time of the first pass encoding. For example, when the encoding unit 21 encodes a title made up of uncompressed video data based on a specified bit rate R under the control of the code amount control unit 25, the generated code amount S [f of each frame f is encoded. ] And the average quantization scale Q [f].

複雑度算出部52は、特徴量観測部51で観測された発生符号量と平均量子化スケールとに基づいて複雑度を計算する。例えば、発生符号量をS[f]、平均量子化スケールをQ[f]、複雑度X[f]とした場合、複雑度X[f]は、
X[f]=S[f]*Q[f]
と計算することができる。
The complexity calculation unit 52 calculates the complexity based on the generated code amount and the average quantization scale observed by the feature amount observation unit 51. For example, when the generated code amount is S [f], the average quantization scale is Q [f], and the complexity X [f], the complexity X [f] is
X [f] = S [f] * Q [f]
And can be calculated.

なお、2パス・エンコードの際の目標符号量を算出するための複雑度Xの計算方法の詳細は、例えば特許文献2に記載されている。通常は、このようにして算 出された複雑度から符号量割り当て部24にて目標符号量を算出し、2パス目のエンコードの際に当該目標符号量となるよう符号化が行なわれる。   Note that details of the calculation method of the complexity X for calculating the target code amount in the two-pass encoding are described in, for example, Patent Document 2. Normally, the code amount allocation unit 24 calculates the target code amount from the complexity calculated in this way, and encoding is performed so that the target code amount is obtained in the second pass encoding.

ここで、後述するように、編集済みストリームには、その符号化後にオリジナルストリームとピクチャ位相を一致させるため、編集点前及び/または編集点後 に必要に応じて挿入画像が挿入される。本実施の形態における複雑度算出部52は、編集済みストリームを符号化して編集済符号化ストリームST1を生成する 際には、オリジナルストリームST0の生成の際に解析した複雑度を参照し、オリジナルストリームにおける対応するフレームの複雑度を符号量割り当て部24 に供給する。また、挿入画像を符号化してピクチャ(以下、挿入ピクチャという。)を生成する際の複雑度を、オリジナルストリームの複雑度から算出して符号 量割り当て部24へ供給する。   Here, as will be described later, an inserted image is inserted into the edited stream as necessary before and / or after the editing point in order to match the picture phase with the original stream after the encoding. When the edited stream is encoded and the edited encoded stream ST1 is generated, the complexity calculating unit 52 in the present embodiment refers to the complexity analyzed at the time of generating the original stream ST0. Is supplied to the code amount assigning unit 24. Also, the complexity when generating the picture by encoding the inserted image (hereinafter referred to as “inserted picture”) is calculated from the complexity of the original stream and supplied to the code amount allocation unit 24.

符号量割り当て部24は、複雑度算出部52から供給される複雑度に基づき各フレームを符号化する(各ピクチャを生成する)際の目標符号量を割り当てる。 目標符号量は、例えば、所定のGOP長などに対応する符号量の割当て区間で使用できる総符号量を画像毎の複雑度に応じて配分する。符号量の割当て区間をL フレームとし、第fフレームから第f+L−1フレームまでのフレームに割当てることができる総符号量をRa[f]とした場合、Ra[f]を複雑度X[f] で比例配分した各フレームの目標符号量T[f]は、割り当て区間の複雑度X[f]の総和をXsumとした場合、
T[f]=(X[f]/Xsum)*Ra[f]
として算出することができる。
The code amount assigning unit 24 assigns a target code amount for encoding each frame (generating each picture) based on the complexity supplied from the complexity calculating unit 52. For the target code amount, for example, the total code amount that can be used in the code amount allocation section corresponding to a predetermined GOP length or the like is distributed according to the complexity of each image. When the code amount allocation interval is L frames and the total code amount that can be allocated to the frames from the f-th frame to the (f + L-1) -th frame is Ra [f], Ra [f] is the complexity X [f]. The target code amount T [f] of each frame that is proportionally distributed in the case where the sum of the complexity X [f] of the allocated section is Xsum,
T [f] = (X [f] / Xsum) * Ra [f]
Can be calculated as

符号量制御部25は、1パス目のエンコードの際には、予め設定されたか又は外部から指示されるビットレートで符号化されるよう符号化処理部2を制御す る。2パス目のエンコードの際には、符号割当て部24からの情報に基づき、量子化スケールを計算し、この量子化スケールにより符号化させる。この際に実際 に発生した発生符号量を計測して発生符号量と割当てた符号量とに差がある場合は、符号量が所定のビットレートに近づくようにフィードバック制御をかけて符 号量を制御することで、目標符号量となるよう符号化が行なわれる。簡単には、発生符号量が目標符号量を上回っている場合には、量子化スケールを大きくして 符号の発生を抑制し、下回っている場合には、量子化スケールを小さくして符号の発生を多くする。   The code amount control unit 25 controls the encoding processing unit 2 so that encoding is performed at a bit rate set in advance or instructed from the outside during the first pass encoding. In the second pass encoding, a quantization scale is calculated based on information from the code assigning unit 24, and encoding is performed using this quantization scale. If there is a difference between the generated code amount and the assigned code amount when the actually generated code amount is measured at this time, feedback control is performed so that the code amount approaches a predetermined bit rate, and the code amount is reduced. By controlling, encoding is performed so that the target code amount is obtained. Briefly, if the generated code amount exceeds the target code amount, the generation of the code is suppressed by increasing the quantization scale, and if it is lower, the quantization scale is decreased to generate the code. To increase.

更に、符号量制御部25は、符号化バッファ22のバッファ占有量を監視し、符号化した際に発生する符号量が符号化バッファ22でオーバーフロー又はアン ダーフローを起こさないように監視して量子化スケールの調整やスタッフィングなどの制御を行う。例えば、符号化バッファ22のオーバーフローを回避する場 合には、量子化スケールを大きくして符号の発生を抑制し、又は符号化すべき情報を符号化せず削除して発生符号量を抑制する。一方、符号化バッファ22のア ンダーフローを回避する場合には、量子化スケールを小さくして符号の発生量を多くし、又はスタッフィングを行って発生符号量を増加させる。   Furthermore, the code amount control unit 25 monitors the buffer occupation amount of the encoding buffer 22, and monitors and quantizes the code amount generated at the time of encoding so that overflow or underflow does not occur in the encoding buffer 22. Control scale adjustment and stuffing. For example, in order to avoid overflow of the encoding buffer 22, the quantization scale is increased to suppress the generation of codes, or the information to be encoded is deleted without encoding, and the generated code amount is suppressed. On the other hand, in order to avoid the underflow of the encoding buffer 22, the quantization scale is reduced to increase the amount of generated code, or stuffing is performed to increase the generated code amount.

符号化部21は、外部から供給される非圧縮の映像データや復号処理部4から送られる復号データを与えられたパラメタに従って符号化し、圧縮データを生成 する。また、符号化部21は、発生符号量を計測して符号量制御部25に通知する。更に、1パス目の符号化の際には、発生符号量、平均量子化スケールを特徴 量観測部51へ通知する。   The encoding unit 21 encodes uncompressed video data supplied from the outside and decoded data sent from the decoding processing unit 4 in accordance with given parameters, and generates compressed data. The encoding unit 21 measures the generated code amount and notifies the code amount control unit 25 of the generated code amount. Further, in the first pass encoding, the generated code amount and the average quantization scale are notified to the feature amount observation unit 51.

符号化バッファ22は、符号化部21で符号化されたデータを蓄積し、固定のビットレートで出力することもできる。この符号化バッファ22により、画像ごとの発生符号量の変動を吸収することができる。   The encoding buffer 22 can store the data encoded by the encoding unit 21 and output it at a fixed bit rate. The encoding buffer 22 can absorb fluctuations in the generated code amount for each image.

図1に戻って復号処理部4は、記憶装置30、40に記録されているMPEGストリームを復号して表示部5を介して表示する他、再符号化するために符号化処理部2へ供給する。図3は、復号処理部4の詳細を示すブロック図である。   Returning to FIG. 1, the decoding processing unit 4 decodes the MPEG stream recorded in the storage devices 30 and 40 and displays it through the display unit 5, and supplies it to the encoding processing unit 2 for re-encoding. To do. FIG. 3 is a block diagram showing details of the decoding processing unit 4.

復号処理部4は、符号化処理部2にて符号化された符号化ストリーム、又は記憶装置30、40に記録されている符号化ストリームを復号する復号部61と、 復号されたオーディオ/ビデオデータを一時保存する復号バッファ62と、復号部61の復号処理のタイミングを制御するポーズ/レジューム制御部63とを有 する。   The decoding processing unit 4 includes a decoding unit 61 that decodes the encoded stream encoded by the encoding processing unit 2 or the encoded stream recorded in the storage devices 30 and 40, and the decoded audio / video data. Are temporarily stored, and a pause / resume control unit 63 that controls the timing of the decoding process of the decoding unit 61.

上述の2パス・エンコードを実行する際には、復号処理部4にて、1パス目で符号化されたオリジナルストリームST0を復号する。ここで、符号化処理部2 にて編集済符号化ストリームST1を生成する場合には、編集部3により生成された仮想のタイトルに当たる編集指示(プレイリスト)に従って、編集部3から 順次GOPが供給され、これを復号処理する。この際、ポーズ/レジューム制御部63により、後述するように編集点がGOPの途中にある場合には、その直前 の復号画像を繰り返し出力したり、編集済符号化ストリームに必要な復号画像のみを出力したりの制御を行う。こうして、復号処理部4が復号して出力する復号 データ(編集済ストリーム)を符号化処理部2にて編集済符号化ストリームST1に符号化する。   When executing the above-described two-pass encoding, the decoding processing unit 4 decodes the original stream ST0 encoded in the first pass. Here, when the edited encoded stream ST1 is generated by the encoding processing unit 2, GOPs are sequentially supplied from the editing unit 3 in accordance with an editing instruction (playlist) corresponding to the virtual title generated by the editing unit 3. This is decrypted. At this time, if the edit point is in the middle of the GOP as will be described later, the pause / resume control unit 63 repeatedly outputs the decoded image immediately before it or only the decoded image necessary for the edited encoded stream. Output and control. In this way, the decoded data (edited stream) decoded and output by the decoding processing unit 4 is encoded by the encoding processing unit 2 into the edited encoded stream ST1.

図1に戻って、編集部3は、記憶装置30に記憶されたオリジナルストリームを所望の編集点で編集されるよう仮想のタイトルに当たるプレイリストを生成す る。また、本実施の形態における編集部3は、プレイリスト編集した映像を2パス・エンコードさせるため、符号化処理部2及び復号処理部4を制御する機能を 有する。なお復号処理部4及び符号化処理部2を制御するための制御部を別途設けてもよい。この制御方法についての詳細は後述する。   Returning to FIG. 1, the editing unit 3 generates a playlist corresponding to a virtual title so that the original stream stored in the storage device 30 is edited at a desired editing point. In addition, the editing unit 3 in the present embodiment has a function of controlling the encoding processing unit 2 and the decoding processing unit 4 in order to cause the pass-edited video to be two-pass encoded. In addition, you may provide the control part for controlling the decoding process part 4 and the encoding process part 2 separately. Details of this control method will be described later.

編集済符号化ストリームST1を生成する際には、編集部3には、例えば、ユーザにより所望の編集点間をカットするなどの指示と、編集済符号化ストリーム ST1を生成する際のビットレート等が指示される。編集部3は、その編集点の指示によりプレイリストを生成することで、オリジナルストリームST0を編集 する。編集部3は、このプレイリストに従ってオリジナルストリームST0のGOPを復号処理部4へ供給させることで、編集済みストリームを再生することが できる。また、編集済みストリームを2パス・エンコードを行なう場合には、復号処理部4に、編集済みストリームを出力させ、符号化処理部2にこれを2パ ス・エンコードさせる。すなわち、エンコード後の編集済み符号化ストリームST1が所望のデータ容量となるよう、ビットレートを指示し、複雑度Xに応じた 目標符号量を割り当てさせ、これに基づき編集済みストリームを符号化させ編集済み符号化ストリームST1を生成させる。   When the edited encoded stream ST1 is generated, for example, the editing unit 3 instructs the user to cut a desired edit point, a bit rate when generating the edited encoded stream ST1, and the like. Is instructed. The editing unit 3 edits the original stream ST0 by generating a playlist in accordance with the editing point instruction. The editing unit 3 can reproduce the edited stream by supplying the GOP of the original stream ST0 to the decoding processing unit 4 according to the playlist. When the edited stream is subjected to two-pass encoding, the decoded processing unit 4 outputs the edited stream, and the encoding processing unit 2 performs two-pass encoding. That is, the bit rate is instructed so that the encoded stream ST1 after encoding has a desired data capacity, a target code amount corresponding to the complexity X is assigned, and the edited stream is encoded and edited based on this. The encoded stream ST1 is generated.

次に、2パス・エンコードによる編集済み符号化ストリームST1の生成方法について詳細に説明する。本実施の形態においては、この画像符号化装置1によ り、既に記録済みのタイトル(オリジナルストリーム)に対して、例えば任意の2つのピクチャを指定して編集を行い、編集したタイトルのダビングをおこなう 場合について説明する。   Next, a method of generating the edited encoded stream ST1 by 2-pass encoding will be described in detail. In the present embodiment, the image encoding device 1 performs editing by designating, for example, any two pictures with respect to an already recorded title (original stream), and dubbing the edited title. The case of performing is explained.

図4は、オリジナルストリームST0の編集方法を示す図である。図4(a)はオリジナルストリームを示す図、図4(b)は、編集点を含むオリジナルストリームのGOPを抜き出して示す図、図4(c)は、編集後のプレイリストの一部を示す図である。   FIG. 4 is a diagram showing a method for editing the original stream ST0. 4A shows the original stream, FIG. 4B shows the GOP of the original stream including the edit points, and FIG. 4C shows a part of the edited playlist. FIG.

図4(a)に示すように、オリジナルストリームST0は、複数のGOP#1、#2,・・#j,・・,#k,・・から構成される。なお、本実施の形態にお いては、説明の簡単のため、各GOPは、N(Nは整数)枚のピクチャから構成されるものとし、更に例えばI、P、B、B、P・・などのピクチャの並び順 (符号化規則)も同一の構成であるものとして説明する。なお、オリジナルストリームST0と編集済符号化ストリームST1とにおいて同一フレームが同一ピ クチャで符号化されていれば本願を適用することができる。つまり、GOP長や符号化規則がGOP間で異なっていてもオリジナルストリームST0と編集済符 号化ストリームST1との間でピクチャ位相が一致していれば、GOP長、符号化規則等を全てのGOPで同一とする必要はない。   As shown in FIG. 4A, the original stream ST0 is composed of a plurality of GOPs # 1, # 2,... #J,. In this embodiment, for simplicity of explanation, each GOP is assumed to be composed of N (N is an integer) pictures, and for example, I, P, B, B, P,. In the following description, it is assumed that the arrangement order of pictures (encoding rules) is the same. Note that the present application can be applied if the same frame is encoded with the same picture in the original stream ST0 and the edited encoded stream ST1. That is, even if the GOP length and the coding rule are different between GOPs, if the picture phase is the same between the original stream ST0 and the edited coded stream ST1, the GOP length, the coding rule, etc. are all set. It is not necessary for GOPs to be the same.

また、オリジナルストリームST0(GOP)を構成する各ピクチャの複雑度は、映像データからオリジナルストリームST0を生成する際に解析部23によって解析され複雑度Xとして記憶装置30に格納されているものとする。   Further, the complexity of each picture constituting the original stream ST0 (GOP) is analyzed by the analysis unit 23 when the original stream ST0 is generated from the video data, and is stored in the storage device 30 as the complexity X. .

以下の説明においては、図4に示す編集点A、Bを使用し、編集済符号化ストリームST1を生成する場合について説明する。ここで、オリジナルストリーム ST0は、GOP#s(1≦s≦S)からなり、各GOP#sは、ピクチャ#t(1≦t≦N)から構成されるものとする。編集点Aは、 GOP#j(1≦j≦S)のピクチャ#n(1≦n≦N)と#n+1の間を示すものとする。なお、ピクチャ#n=#Nの場合には、編集点AはGOP境界を示 す。更に、編集点A以降のピクチャはカットされるものとする。また、編集点Bは、GOP#k(1≦k≦S)の#m−1と#m(1≦m≦N)との間を示すも のとする。なお、ピクチャ#m=#1の場合は、編集点BはGOP境界を示す。更に、編集点B以前のピクチャはカットされるものとする。   In the following description, a case where the edited encoded stream ST1 is generated using the editing points A and B shown in FIG. 4 will be described. Here, the original stream ST0 is composed of GOP # s (1 ≦ s ≦ S), and each GOP # s is composed of a picture #t (1 ≦ t ≦ N). The edit point A is assumed to indicate between a picture #n (1 ≦ n ≦ N) and # n + 1 of GOP # j (1 ≦ j ≦ S). When picture # n = # N, edit point A indicates a GOP boundary. Furthermore, it is assumed that the pictures after the editing point A are cut. The edit point B is assumed to indicate between # m−1 and #m (1 ≦ m ≦ N) of GOP # k (1 ≦ k ≦ S). When picture # m = # 1, edit point B indicates a GOP boundary. Furthermore, it is assumed that the picture before the editing point B is cut.

例えば、図4(b)に示すように、GOP単位で見た場合には、GOP#jの先頭ピクチャ#1乃至編集点A直前のピクチャ#nまでのストリームと、 GOP#kの編集点B直後のピクチャ#m乃至最終ピクチャ#Nまでのストリームとが抜き出され、図4(c)に示すように、編集点A、Bが連続するよう編集 される。   For example, as shown in FIG. 4B, when viewed in GOP units, the stream from the first picture # 1 of GOP #j to picture #n immediately before editing point A and the editing point B of GOP #k The stream from the next picture #m to the last picture #N is extracted and edited so that the edit points A and B are continuous as shown in FIG.

編集部3は、オリジナルストリーム中の任意の2つの編集点Aと編集点Bを指定してオリジナルストリーム(タイトル)を編集することができる。すなわち、 編集点Aで編集済みストリームを終了させたり、編集点Bで編集済みストリームを開始させたり、又は編集点Aと編集点Bとを連続して再生されるような編集済 みストリームとすることができる。編集の際にはオリジナルストリームへ操作の有無に関わらず、仮想のタイトルに当たるプレイリストを生成する。なお、プレ イリストを生成する際にオリジナルストリームを編集操作してもよい。この編集部3は、このプレイリストを参照しながら、MPEG AVデコーダである復号 処理部4へGOP単位でストリームを供給することにより、例えば編集点Aと編集点Bとを連続再生させる。   The editing unit 3 can edit the original stream (title) by designating any two editing points A and B in the original stream. That is, the edited stream is ended at the editing point A, the edited stream is started at the editing point B, or the editing point A and the editing point B are continuously played back. be able to. When editing, a playlist corresponding to a virtual title is generated regardless of whether or not the original stream is operated. The original stream may be edited when generating the playlist. The editing unit 3 continuously reproduces, for example, the editing point A and the editing point B by supplying a stream in GOP units to the decoding processing unit 4 that is an MPEG AV decoder while referring to the playlist.

この復号処理部4が出力するオーディオ及びビデオ信号を表示部5に出力することで編集済みストリームを再生することができ、また、復号処理部4が復号し た編集済みストリームを符号化処理部2へ入力して符号化処理する際にオリジナルストリームの複雑度を参照することで2パス・エンコードを行なう。そして、 これを記憶装置40へ供給することでオリジナルストリームから編集した編集済みストリームの2パス・エンコードでの記録(ダビング)を行なうことができ る。   The edited stream can be reproduced by outputting the audio and video signals output by the decoding processing unit 4 to the display unit 5, and the edited stream decoded by the decoding processing unit 4 can be reproduced by the encoding processing unit 2. 2-pass encoding is performed by referring to the complexity of the original stream when encoding is performed. Then, by supplying this to the storage device 40, the edited stream edited from the original stream can be recorded (dubbed) by two-pass encoding.

2パス・エンコードでは、2パス目の符号化時の各フレームのピクチャ・タイプ(ピクチャ位相)は1パス目の符号化時と同じであることが条件となる。1パ ス目において解析した複雑度に応じて符号量を割り当てるため、ピクチャ位相が異なると適切な符号量を割り当てることができないためである。   In 2-pass encoding, the condition is that the picture type (picture phase) of each frame at the time of encoding in the second pass is the same as that at the time of encoding in the first pass. This is because the code amount is assigned according to the complexity analyzed in the first pass, and therefore, if the picture phase is different, an appropriate code amount cannot be assigned.

よって、符号化処理部2が生成する編集済み符号化ストリームST1の各GOPでのピクチャ構造の規則とGOP長(GOP中のピクチャ総数)(以下、これ らをピクチャ構成ともいう。)は、1パス目の符号化時と同様にする必要がある。すなわち、編集済み符号化ストリームST1のピクチャ位相をオリジナルスト リームの位相と一致させる必要がある。   Therefore, the rule of the picture structure and the GOP length (total number of pictures in the GOP) in each GOP of the edited encoded stream ST1 generated by the encoding processing unit 2 (hereinafter also referred to as a picture configuration) are 1. It is necessary to be the same as when encoding the pass. That is, it is necessary to match the picture phase of the edited encoded stream ST1 with the phase of the original stream.

図5乃至図7は、編集済みストリームを生成する方法を説明する図である。編集部3は、図5乃至図7に示す6通りの場合に分けて、復号処理部4及び符号化 処理部2を制御する。図5に示すのは、2つの編集点A、Bをつなぎ合わせる場合であって、図4(c)に示すGOP#jのピクチャ#1乃至#n及び GOP#kのピクチャ#m乃至#Nからなるピクチャ群(以下、編集ピクチャ群という。)に含まれるピクチャ総数がNの整数倍とは異なる場合には、編集点 A、Bの間に所定の画像(挿入画像)を1又は複数枚挿入し、これを符号化した際のピクチャ群(以下、再符号化ピクチャ群という。)に含まれるピクチャ総数 がNの整数倍となるよう制御する。   5 to 7 are diagrams illustrating a method for generating an edited stream. The editing unit 3 controls the decoding processing unit 4 and the encoding processing unit 2 in the six cases shown in FIGS. FIG. 5 shows a case where two editing points A and B are connected, and pictures # 1 to #n of GOP #j and pictures #m to #N of GOP #k shown in FIG. If the total number of pictures included in the picture group consisting of (hereinafter referred to as an edited picture group) is different from an integer multiple of N, one or more predetermined images (inserted images) are placed between the editing points A and B. The total number of pictures included in a picture group (hereinafter referred to as a re-encoded picture group) when inserted and encoded is controlled to be an integer multiple of N.

また、図6に示すのは、編集ピクチャ群に含まれるピクチャ総数がN又は2N枚である場合である。この場合には、編集点Bは編集済符号化ストリームST1 においてGOP境界と一致するため挿入画像を挿入する必要がない。更に図7に示すのは、編集点が1箇所の場合であり、編集点Bが先頭にくる場合や、編集点 Aで編集済みストリームが終了する場合を示す。これらの6通りの編集方法を1以上組み合わせて編集済みストリームが生成される。   FIG. 6 shows a case where the total number of pictures included in the edited picture group is N or 2N. In this case, the edit point B coincides with the GOP boundary in the edited encoded stream ST1, so that it is not necessary to insert an insertion image. Further, FIG. 7 shows a case where there is one edit point, and a case where the edit point B comes to the top or a case where the edited stream ends at the edit point A. An edited stream is generated by combining one or more of these six editing methods.

先ず、編集ピクチャ群に含まれるピクチャ総数がNの整数倍にならない場合について説明する。   First, a case where the total number of pictures included in the edited picture group does not become an integer multiple of N will be described.

(1)n+(N−m+1)<N(図5(a)参照)
図5(a)に示すように、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))<Nの場合とは、GOP#jの先頭ピクチャ#1乃至編集点Aまで のピクチャ#n(GOP#jの一部)102に含まれるピクチャ数n、GOP#kの編集点B以降のピクチャ#m乃至最終ピクチャ#N(GOP#kの一 部)103に含まれるピクチャ数(N−m+1)の和n+(N−m+1)がN未満である場合である。
(1) n + (N−m + 1) <N (see FIG. 5A)
As shown in FIG. 5A, when the total number of pictures included in the edited picture group (n + (N−m + 1)) <N, the picture #n from the first picture # 1 to the edit point A of GOP # j (A part of GOP # j) The number of pictures included in 102, the number of pictures included in the picture #m through the last picture #N (part of GOP # k) 103 (N− This is a case where the sum n + (N−m + 1) of m + 1) is less than N.

この場合、編集部3は、GOP#j中の編集点Aと編集点Bとの間に、GOP#jのピクチャ#nを復号した第1の復号画像Jを(m−n−1)枚挿入して再 符号化ピクチャ群101を生成するよう符号化処理部2を制御する。すなわち、編集部3は、復号画像Jを編集ピクチャ群の編集点A、Bの間に(m−n−1) 枚挿入させることで、再符号化ピクチャ群のピクチャ枚数をN枚とする。このことにより、再符号化ピクチャ群101をGOPと同一ピクチャ枚数とする。   In this case, the editing unit 3 (m−n−1) first decoded images J obtained by decoding the picture #n of GOP # j between the editing point A and the editing point B in GOP # j. The encoding processing unit 2 is controlled to insert and generate the re-encoded picture group 101. In other words, the editing unit 3 inserts (mn−1) decoded images J between the editing points A and B of the edited picture group, so that the number of pictures in the re-encoded picture group is N. As a result, the re-encoded picture group 101 has the same number of pictures as the GOP.

復号画像Jを(m−n−1)枚挿入することで、GOP#jの一部102、GOP#kの一部103を、それぞれGOP#j、#kと同一ピクチャ位相とする ことができる。これにより、ピクチャ位相が一致しているGOP#jの一部102、GOP#kの一部103については、GOP#j、#kの複雑度Xを参照す ることができる。   By inserting (m−n−1) decoded images J, a part 102 of GOP # j and a part 103 of GOP # k can have the same picture phase as GOP # j and #k, respectively. . Thereby, the complexity X of GOP # j and #k can be referred to for the part 102 of GOP # j and the part 103 of GOP # k having the same picture phase.

ところで、復号画像Jを符号化した挿入ピクチャ(第1の挿入ピクチャ)は、オリジナルストリームST0には存在しないピクチャであり、その複雑度は解析 されていない。しかし、この復号画像Jは、GOP#jのピクチャ#nを復号した画像であり、画像JからGOP#jのピクチャ#nを生成する際の複雑度は事 前解析により得られている。そこで、本実施の形態においては、復号画像Jから生成する挿入ピクチャの複雑度を、このGOP#jのピクチャ#nを生成する際 に事前解析された複雑度に基づき算出することとする。これにより、編集済みストリームの各ピクチャを生成する際の複雑度が参照又は演算により求まること で、編集済みストリームを生成する際には、最適な符号量を割り当て2パス・エンコードを行なうことができる。復号画像Jから生成する挿入ピクチャの複雑度 の算出方法及び複雑度を利用した符号化処理については後述する。   By the way, the inserted picture (first inserted picture) obtained by encoding the decoded image J is a picture that does not exist in the original stream ST0, and its complexity has not been analyzed. However, this decoded image J is an image obtained by decoding the picture #n of GOP # j, and the complexity when generating the picture #n of GOP # j from the image J is obtained by a prior analysis. Therefore, in the present embodiment, the complexity of the inserted picture generated from the decoded image J is calculated based on the complexity analyzed in advance when generating the picture #n of this GOP # j. As a result, the complexity of generating each picture of the edited stream can be obtained by reference or calculation, so that when the edited stream is generated, an optimal code amount can be assigned and two-pass encoding can be performed. . The calculation method of the complexity of the inserted picture generated from the decoded image J and the encoding process using the complexity will be described later.

(2)n+(N−m+1)>N(図5(b)参照)
図5(b)に示すように、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))>Nの場合とは、GOP#jの先頭ピクチャ#1乃至編集点Aまで のピクチャ#n(GOP#jの一部)102に含まれるピクチャ数n、GOP#kの編集点B以降のピクチャ#m乃至最終ピクチャ#N(GOP#kの一 部)103に含まれるピクチャ数(N−m+1)の和n+(N−m+1)がNを超える場合である。
(2) n + (N−m + 1)> N (see FIG. 5B)
As shown in FIG. 5B, when the total number of pictures included in the edited picture group (n + (N−m + 1))> N, pictures #n from the first picture # 1 to the edit point A of GOP # j (A part of GOP # j) The number of pictures included in 102, the number of pictures included in the picture #m through the last picture #N (part of GOP # k) 103 (N− This is a case where the sum n + (N−m + 1) of m + 1) exceeds N.

この場合、編集部3は、GOP#j中の編集点Aと編集点Bとの間に、GOP#jのピクチャ#nを復号した復号画像Jを((N−m)+m−1)枚挿入して 再符号化ピクチャ群111を生成するよう符号化処理部2を制御する。すなわち、編集部3は、GOP#jのピクチャ#nの復号画像Jを、編集ピクチャ群の編 集点A、Bの間に((N−m)+m−1)枚挿入させることで、再符号化ピクチャ群のピクチャ枚数を2N枚とする。   In this case, the editing unit 3 generates ((N−m) + m−1) decoded images J obtained by decoding the picture #n of GOP # j between the editing point A and the editing point B in GOP # j. The encoding processing unit 2 is controlled to insert and generate the re-encoded picture group 111. That is, the editing unit 3 inserts ((N−m) + m−1) copies of the decoded image J of the picture #n of GOP # j between the editing points A and B of the edited picture group. The number of pictures in the coded picture group is 2N.

復号画像Jを((N−m)+m−1)枚挿入することで、GOP#jの一部102、GOP#kの一部103を、それぞれGOP#j、#kと同一ピクチャ位 相とすることができる。これにより、ピクチャ位相が一致しているGOP#jの一部102、GOP#kの一部103については、GOP#j、#kの複雑度X を参照することができる。また、挿入ピクチャの複雑度については上述と同様に、GOP#jのピクチャ#nの複雑度から算出するものとする。   By inserting ((N−m) + m−1) decoded images J, a part 102 of GOP # j and a part 103 of GOP # k have the same picture phase as GOP # j and #k, respectively. can do. As a result, for the part 102 of GOP # j and the part 103 of GOP # k having the same picture phase, it is possible to refer to the complexity X of GOP # j and #k. Further, the complexity of the inserted picture is calculated from the complexity of the picture #n of GOP # j as described above.

更に、上述の場合には、GOP#jのピクチャ#nの復号画像Jを挿入する場合について説明したが、挿入画像を以下のようにしてもよい。すなわち、挿入画 像として、復号画像Jのみならず、GOP#kのピクチャ#mの復号画像Kを使用する。そして、GOP#jの一部102に挿入画像Jを挿入することでフレー ム数をN枚とし、挿入画像KとGOP#kの一部103とでフレーム数をN枚とし、これらにより2N枚からなる再符号化ピクチャ群を構成してもよい。この場 合には、編集点Aから編集点Bまでを復号した映像は、復号画像J、Kの静止画像となり、復号画像Jのみとするより、より自然な編集結果を得られる。   Further, in the above-described case, the case where the decoded image J of the picture #n of GOP # j is inserted has been described, but the inserted image may be as follows. That is, not only the decoded image J but also the decoded image K of the picture #m of GOP # k is used as the insertion image. Then, the number of frames is set to N by inserting the inserted image J into the part 102 of GOP # j, and the number of frames is set to N by the inserted image K and the part 103 of GOP # k. A re-encoded picture group may be configured. In this case, the video decoded from the editing point A to the editing point B becomes a still image of the decoded images J and K, and a more natural editing result can be obtained than when only the decoded image J is used.

(3)n+(N−m+1)=2N(図6(a)参照)
図6(a)に示すように、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))=2Nの場合とは、GOP#jの先頭ピクチャ#1乃至編集点Aま でのピクチャ#n(GOP#jの一部)102に含まれるピクチャ数n、GOP#kの編集点B以降のピクチャ#m乃至最終ピクチャ#N(GOP#kの一 部)103に含まれるピクチャ数(N−m+1)の和n+(N−m+1)=2Nの場合である。
(3) n + (N−m + 1) = 2N (see FIG. 6A)
As shown in FIG. 6A, when the total number of pictures included in the edited picture group (n + (N−m + 1)) = 2N, the picture # from the first picture # 1 to the edit point A of GOP # j n (a part of GOP # j) 102, the number of pictures n, the number of pictures included in the picture #m through the final picture #N (part of GOP # k) 103 after the editing point B of GOP # k (N This is a case where the sum n + (N−m + 1) = 2N of −m + 1).

すなわち、GOP#jのピクチャ#n=ピクチャ#N、GOP#jのピクチャ#m=ピクチャ#1であり、GOP#jの一部102がGOP#jの全部に一致 し、GOP#kの一部103がGOP#kの全部に一致する場合であって編集点A、Bを接続した編集後の再符号化ピクチャ群(=編集ピクチャ群)121は1 パス目のGOPと同位相となる場合である。この場合には、上記(1)、(2)とは異なり、挿入画像を挿入することなく、そのままGOPの複雑度を用いて2 パス目のエンコードを行なうことができる。この場合、GOP#kの一部103=GOP#kをクローズドGOP化してもよい。   That is, picture #n of GOP # j = picture #N, picture #m of GOP # j = picture # 1, part 102 of GOP # j matches all of GOP # j, and one of GOP # k When the section 103 matches all of GOP # k and the re-encoded picture group (= edited picture group) 121 after editing with the editing points A and B connected has the same phase as the GOP in the first pass It is. In this case, unlike the above (1) and (2), the second-pass encoding can be performed using the complexity of the GOP as it is without inserting an insertion image. In this case, a part 103 = GOP # k of GOP # k may be turned into a closed GOP.

(4)n+(N−m+1)=N(図6(b)参照)
図6(b)に示すように、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))=2Nの場合とは、GOP#jの先頭ピクチャ#1乃至編集点Aま でのピクチャ#n(GOP#jの一部)102に含まれるピクチャ数n、GOP#kの編集点B以降のピクチャ#m乃至最終ピクチャ#N(GOP#kの一 部)103に含まれるピクチャ数(N−m+1)の和n+(N−m+1)=Nの場合である。
(4) n + (N−m + 1) = N (see FIG. 6B)
As shown in FIG. 6B, the total number of pictures included in the edited picture group (n + (N−m + 1)) = 2N means that the picture # from the first picture # 1 to the edit point A of GOP # j. n (a part of GOP # j) 102, the number of pictures n, the number of pictures included in the picture #m through the final picture #N (part of GOP # k) 103 after the editing point B of GOP # k (N This is the case where the sum n + (N−m + 1) = N.

この場合においても、編集点A、Bを接続した編集後の再符号化ピクチャ群(=編集ピクチャ群)131は、GOPと同一ピクチャ位相となっており、上記(3)と同様、挿入画像を挿入する処理をすることなく、このまま2パス目のエンコードを行なうことができる。   Even in this case, the re-encoded picture group (= edited picture group) 131 after editing with the editing points A and B connected has the same picture phase as that of the GOP. The second pass encoding can be performed as it is without performing the insertion process.

(5)GOP#kが先頭に位置する場合(図7(a)参照)
図7(a)に示すように、例えば図4の編集点Bからオリジナルストリームの最終ピクチャまでを編集済みストリームとする場合、すなわち、GOP#k=GOP#1の場合である。
(5) When GOP # k is positioned at the head (see FIG. 7A)
As shown in FIG. 7A, for example, the edited stream from the editing point B to the last picture of the original stream in FIG. 4 is used, that is, GOP # k = GOP # 1.

この場合、GOP#kの編集点B以降のピクチャ#m乃至最終ピクチャ#N(GOP#kの一部)103が編集ピクチャ群となるが、これをこのまま先頭 GOPとすると、GOP#kのピクチャ#mがIピクチャに符号化されることになり、このままでは2パス目のエンコードの際にピクチャ位相が一致せず、オリ ジナルストリームの複雑度を参照することができない。よって、GOP#kの一部103の前に(m−1)枚の挿入画像を挿入して再符号化ピクチャ群141を 得ることで、ピクチャ枚数をN枚とする。この場合、位相を揃えるために挿入する挿入画像は、予め用意した例えば単色画像M1〜M(m−1)とすることがで きる。なお、例えばGOP#kのピクチャ#mを復号した復号画像Kを挿入画像とするなどしてもよい。位相合わせのために単色画像を挿入する場合には、符号 量が少なくてすむため、単色画像用の予め用意された複雑度を設定することができる。   In this case, the picture #m to the last picture #N (part of GOP # k) 103 after the edit point B of GOP # k are the edit picture group. If this is the first GOP as it is, the picture of GOP # k #M is encoded into an I picture, and if this is the case, the picture phase does not match during the second pass encoding, and the complexity of the original stream cannot be referred to. Therefore, by inserting (m−1) inserted images before the part 103 of GOP # k to obtain the re-encoded picture group 141, the number of pictures is N. In this case, the inserted images to be inserted in order to align the phases can be prepared as, for example, monochrome images M1 to M (m−1). For example, a decoded image K obtained by decoding picture #m of GOP # k may be used as an inserted image. When a monochrome image is inserted for phase matching, the amount of code can be reduced, so that a complexity prepared in advance for a monochrome image can be set.

ここで、上記挿入画像を符号化した挿入ピクチャもオリジナルストリームには存在しないピクチャであり、その複雑度は解析されていないが、単色画像を符号 化して挿入ピクチャとする場合、その符号量は極めて少なくてよく、複雑度の値を適宜設定しておくことができる。また、復号画像Kを挿入画像とする場合に は、上述と同様に、GOP#kのピクチャ#mを生成した際の複雑度から算出するものとする。   Here, the inserted picture obtained by encoding the inserted image is also a picture that does not exist in the original stream, and its complexity has not been analyzed. However, when a monochrome image is encoded to be an inserted picture, the amount of code is extremely large. The number may be small, and the complexity value can be set as appropriate. Further, when the decoded image K is an insertion image, it is calculated from the complexity when the GOP # k picture #m is generated as described above.

(6)GOP#jが末尾に位置する場合(図7(b)参照)
図7(b)に示すように、例えば図4の編集点Bからオリジナルストリームの最終ピクチャまでを編集済みストリームとする場合、すなわち、GOP#k=GOP#Sの場合である。
(6) When GOP # j is located at the end (see FIG. 7B)
As shown in FIG. 7B, for example, the edited stream from the editing point B to the last picture of the original stream in FIG. 4 is used, that is, GOP # k = GOP # S.

この場合、GOP#jの先頭ピクチャ#1乃至編集点Aまでのピクチャ#n(GOP#jの一部)102が編集ピクチャ群となるが、そのピクチャ枚数はn枚 である。この場合には、上述と同様、GOP#jの一部102の後ろにGOP#jのピクチャ#nを復号した画像Jを(N−n)枚挿入して再符号化ピクチャ群 151とすることで、そのピクチャ総数をN枚としてGOP長を揃えることができる。   In this case, the picture #n (part of GOP # j) 102 from the first picture # 1 to the editing point A of GOP # j is an edited picture group, but the number of pictures is n. In this case, as described above, (N−n) images J obtained by decoding the picture #n of the GOP # j are inserted after the part 102 of the GOP # j to form the recoded picture group 151. Thus, the GOP length can be made uniform with the total number of pictures as N.

ただし、GOP#jが最終GOPである場合には、必ずしも(N−n)枚の挿入画像を挿入せずともピクチャ位相を揃え、2パス目のエンコードの際に1パス 目の複雑度を参照することができる。つまり、例えばピクチャ#nがピクチャ#1でIピクチャである場合には、挿入画像を挿入せずとも編集点Aまでの複雑度 はオリジナルストリームST0の複雑度を引用でき、2パス・エンコードが可能である。またピクチャ#nがPピクチャやBピクチャである場合には、ピク チャ#nを復号できる最低限の枚数の挿入画像を挿入するものとすれば2パス・エンコードが可能となる。この場合、上述と同様、編集点Aまでの複雑度はオリ ジナルストリームST0の複雑度を引用し、挿入ピクチャの複雑度は、GOP#jのピクチャ#nの複雑度から算出すればよい。   However, if GOP # j is the final GOP, the picture phase is aligned without necessarily inserting (N−n) inserted images, and the complexity of the first pass is referenced during the second pass encoding. can do. That is, for example, when picture #n is picture # 1 and an I picture, the complexity up to edit point A can be quoted from the complexity of original stream ST0 without inserting an insertion image, and two-pass encoding is possible. It is. If picture #n is a P picture or a B picture, two-pass encoding is possible if a minimum number of inserted images that can decode picture #n are inserted. In this case, similarly to the above, the complexity up to the editing point A refers to the complexity of the original stream ST0, and the complexity of the inserted picture may be calculated from the complexity of the picture #n of GOP # j.

以上のようにして、オリジナルストリームを構成するGOPの途中で編集し、編集後に復号し、再度符号化して符号化ストリームを生成しても、オリジナルス トリームと同じフレームについてはピクチャタイプを一致させ、ピクチャ位相を揃えることができる。したがって、編集済みストリームは、オリジナルストリー ムと同じピクチャタイプに符号化されるため、画質の劣化がない。また、このことにより、オリジナルストリームを生成する際に複雑度を解析しておけば、編集 済み符号化ストリームを生成する際には、その複雑度を参照することができ、この複雑度に応じて最適な符号量を割り当てた2パス・エンコードを可能にする。   As described above, even if editing is performed in the middle of the GOP constituting the original stream, decoding is performed after the editing, and the encoded stream is generated by re-encoding, the picture type is matched for the same frame as the original stream, The picture phase can be aligned. Therefore, since the edited stream is encoded in the same picture type as the original stream, there is no deterioration in image quality. This also means that if the complexity is analyzed when the original stream is generated, the complexity can be referred to when the edited encoded stream is generated. Enables two-pass encoding with an optimal code amount assigned.

なお、上記(1)、(4)、(5)、(6)においては、それぞれ再符号化ピクチャ群101、131、141、151のピクチャ総数をN枚とする場 合、(2)、(3)においては、それぞれ再符号化ピクチャ群111、121のピクチャ総数を2N枚とする場合について説明したが、再符号化ピクチャ群のピ クチャ総数はこれらに限らない。すなわち、再符号化ピクチャ群のピクチャ総数がNの整数倍であれば、編集済符号化ストリームST1における編集点Aについ ては、編集済符号化ストリームST1における編集点前後におけるフレームをオリジナルストリームST0と同一のピクチャタイプとしてピクチャ位相を一致さ せることができる。   In the above (1), (4), (5), and (6), if the total number of pictures in the re-encoded picture groups 101, 131, 141, and 151 is N, respectively (2), ( In 3), the case where the total number of pictures in the re-encoded picture groups 111 and 121 is 2N has been described, but the total number of pictures in the re-encoded picture group is not limited thereto. That is, if the total number of pictures in the re-encoded picture group is an integer multiple of N, for the editing point A in the edited encoded stream ST1, the frames before and after the editing point in the edited encoded stream ST1 are referred to as the original stream ST0. The picture phase can be matched for the same picture type.

次に、本実施の形態にかかる2パス・エンコード方法について詳細に説明する。図8、図9は、2パス目のエンコード方法を示すフローチャートである。画像 符号化装置1に接続される記憶装置30には、予め複雑度が解析されたオリジナルストリームが記憶されているものとする。ユーザは、このタイトルを編集した プレイリストを作成し、これを2パス・エンコードを用いて記憶装置40に記録するものとする。   Next, the two-pass encoding method according to the present embodiment will be described in detail. 8 and 9 are flowcharts showing the second pass encoding method. It is assumed that the storage device 30 connected to the image encoding device 1 stores an original stream whose complexity has been analyzed in advance. It is assumed that the user creates a playlist in which the title is edited and records it in the storage device 40 using two-pass encoding.

なお、本実施の形態においては、表示部5にて編集済みのタイトルを再生しつつ、これを再符号化して記憶装置40に記録する場合について説明するが、表示 部5にて再生することなく記録するようにしてもよい。また、記憶装置30に記録されているオリジナルストリームST0を1パス目のオリジナルの符号化スト リーム、記憶装置40に記録する編集済符号化ストリームST1を2パス・エンコードにより符号化して記憶する編集済みのMPEG符号化ストリームとして説 明する。   In the present embodiment, a case will be described in which a title that has been edited on the display unit 5 is reproduced and re-encoded and recorded in the storage device 40. However, the title is not reproduced on the display unit 5. It may be recorded. In addition, the original stream ST0 recorded in the storage device 30 is an original encoded stream of the first pass, and the edited encoded stream ST1 recorded in the storage device 40 is encoded and stored by two-pass encoding. This will be explained as an MPEG encoded stream.

図8に示すように、先ず、画像符号化装置1は、編集されたプレイリストから全ピクチャ数、編集点を含むGOPの再生時刻、及び編集点のピクチャ再生時刻 の情報を取得する(ステップS1)。各種情報を取得した後、編集されたオリジナルストリーム(タイトル)を表示部5にて表示する(ステップS2)。そし て、編集部3は、編集点が上述した(1)〜(6)のいずれに当てはまるかを判断し、この判断結果に応じて復号処理部4、符号化処理部2を制御しつつ2パ ス・エンコードを実行させる。先ず、プレイリストの先頭GOPに編集点が存在するか否かを判定する(ステップS3)。先頭GOPに編集点が存在しない場合 には、後述する図9に示す処理を実行する。   As shown in FIG. 8, first, the image encoding device 1 acquires information about the total number of pictures, the GOP playback time including the editing point, and the picture playback time of the editing point from the edited playlist (step S1). ). After acquiring various information, the edited original stream (title) is displayed on the display unit 5 (step S2). Then, the editing unit 3 determines which of the above-described (1) to (6) the editing point is applied, and controls the decoding processing unit 4 and the encoding processing unit 2 according to the determination result while 2 Causes path encoding to be performed. First, it is determined whether an edit point exists in the first GOP of the playlist (step S3). If there is no edit point in the first GOP, the process shown in FIG. 9 described later is executed.

一方、先頭GOPに編集点がある場合は、編集部3は以下の処理を行う。ここでは、上述の(5)、図7(a)に示す場合、すなわち、先頭GOPに編集点B が存在する場合について説明する。この場合、編集部3の制御のもと、復号処理部4は、先頭GOPから復号処理を開始するが、編集点Bの再生時刻までは GOPを出力させない。すなわち、表示部5では、再生画像については予め用意された単色画像などの挿入画像を表示し(挿入画像出力(ビデオ・ミュート制 御))、音声についてはミュート処理を行う(オーディオ・ミュート制御)(ステップS4)。符号化処理部2は、復号処理部4から出力される単色画像などの 挿入画像を2パス・エンコード、すなわち複雑度に応じて符号量を制御しつつ符号化を行なう。   On the other hand, when there is an editing point in the first GOP, the editing unit 3 performs the following processing. Here, the case shown in the above (5) and FIG. 7A, that is, the case where the edit point B 1 exists in the first GOP will be described. In this case, under the control of the editing unit 3, the decoding processing unit 4 starts the decoding process from the head GOP, but does not output the GOP until the playback time of the editing point B. That is, the display unit 5 displays an inserted image such as a monochrome image prepared in advance for the reproduced image (inserted image output (video mute control)), and performs a mute process for audio (audio mute control). (Step S4). The encoding processing unit 2 encodes an insertion image such as a monochromatic image output from the decoding processing unit 4 by two-pass encoding, that is, controlling the code amount according to the complexity.

上記処理中の編集点Bまでは、復号処理部4から出力される上記挿入画像を、所定の形式のピクチャに符号化していく。この場合、簡単には、オリジナルスト リームのGOPのピクチャ構成と同一ピクチャ構成になるよう符号化すればよいが、N−m枚の挿入画像を挿入すれば、編集点B以降のピクチャ位相を揃えるこ とができるので、挿入画像を符号化する際のピクチャタイプは、オリジナルストリームのGOPのピクチャ構成と異なっていてもよい。この挿入画像はオリジナ ルストリームST0には存在しない画像であるため、当該挿入画像の複雑度も存在しない。   Up to the editing point B being processed, the inserted image output from the decoding processing unit 4 is encoded into a picture of a predetermined format. In this case, it may be simply encoded so as to have the same picture configuration as that of the GOP of the original stream, but if Nm inserted images are inserted, the picture phases after the editing point B are aligned. Therefore, the picture type for encoding the inserted image may be different from the GOP picture configuration of the original stream. Since this inserted image is an image that does not exist in the original stream ST0, the complexity of the inserted image does not exist.

そこで、本実施の形態においては、複雑度算出部52がこの挿入画像の複雑度を適宜算出するものとする。例えば、オリジナルストリームの先頭GOPの対応 する複雑度に基づき算出することができる。なお、挿入画像が単色画像である場合には、符号量は極めて小さくてよく、予め用意された複雑度等を用いてもよ い。また、先頭に配置される挿入画像はIピクチャとして復号されるため、その複雑度はオリジナルストリームの先頭GOPの先頭ピクチャの複雑度又はその数 分の1などとしてもよい。符号量割り当て部24は、当該複雑度を取得し、この複雑度に応じて目標符号量を決定して挿入画像をGOPと同一ピクチャ位相とし て順次符号化していく(ステップS5)。   Therefore, in the present embodiment, the complexity calculation unit 52 appropriately calculates the complexity of the inserted image. For example, it can be calculated based on the corresponding complexity of the first GOP of the original stream. When the inserted image is a single color image, the code amount may be extremely small, and a complexity or the like prepared in advance may be used. Further, since the inserted image arranged at the head is decoded as an I picture, the complexity thereof may be the complexity of the head picture of the head GOP of the original stream or a fraction thereof. The code amount assigning unit 24 acquires the complexity, determines a target code amount according to the complexity, and sequentially encodes the inserted image with the same picture phase as that of the GOP (step S5).

そして、編集点Bの再生時刻になった時点(ステップS6:Yes)で、復号処理部4はGOP#kのピクチャ#m以降の復号結果を出力させる(復号画像出 力(ビデオ・アンミュート)/オーディオ・アンミュート制御)(ステップS7)。これにより、符号化処理部2は、編集点B以降は、オリジナルストリームの 復号データを受け取り符号化する。編集点B以降は、オリジナルストリームとピクチャ位相が同じであるため、複雑度算出部52は、記憶装置30に保存されて いるオリジナルストリームの複雑度を読出し、符号量割り当て部24は、この複雑度に応じて目標符号量を決定し、符号化部2はこの目標符号量で復号データを MPEG符号化していき、後述するステップS10へ進む。   Then, when the playback time of the editing point B is reached (step S6: Yes), the decoding processing unit 4 outputs the decoding result after the picture #m of GOP #k (decoded image output (video unmute)) / Audio unmute control) (step S7). As a result, the encoding processing unit 2 receives and encodes the decoded data of the original stream after the editing point B. Since the picture phase is the same as that of the original stream after the editing point B, the complexity calculation unit 52 reads the complexity of the original stream stored in the storage device 30, and the code amount allocation unit 24 reads the complexity. The encoding unit 2 MPEG-encodes the decoded data with this target code amount, and proceeds to step S10 described later.

次に、ステップS3において、先頭GOPに編集点がない場合には、図9のステップS8に進み、プレイリストの先頭GOPに編集点がない場合には、復号処 理部4にて先頭GOPから復号を開始する。そして、符号化処理部2では、複雑度算出部52がオリジナルストリームの対応するGOPの各ピクチャの複雑度を 読み出し、符号量割り当て部24が目標符号量を算出して割り当て、符号化部21はこの目標符号量で復号処理部4が出力する復号データをMPEG符号化して いく(ステップS9)。   Next, if there is no edit point in the first GOP in step S3, the process proceeds to step S8 in FIG. 9, and if there is no edit point in the first GOP of the playlist, the decoding processing unit 4 starts from the first GOP. Start decryption. In the encoding processing unit 2, the complexity calculating unit 52 reads the complexity of each picture of the corresponding GOP of the original stream, the code amount assigning unit 24 calculates and assigns the target code amount, and the encoding unit 21 The decoded data output from the decoding processing unit 4 is MPEG-encoded with this target code amount (step S9).

こうして復号処理部4にて復号した画像を符号化処理部2にて、編集点Aの再生時刻まで、複雑度に応じて符号量を制御しつつ符号化する2パス・エンコード を行なう。そして、編集点Aの再生時刻になったら(ステップS10:Yes)、復号処理部4は、その出力を、その直前に復号したGOP#jのピクチャ#n の復号画像Jを繰り返し復号するなどして、そのままポーズする(デコード・ポーズ制御)。その際、オーディオはミュートする(オーディオ・ミュート制御) (ステップS11)。   In this way, the image decoded by the decoding processing unit 4 is encoded by the encoding processing unit 2 until the reproduction time of the editing point A, and the two-pass encoding is performed while controlling the code amount according to the complexity. When the playback time of the editing point A is reached (step S10: Yes), the decoding processing unit 4 repeatedly decodes the decoded image J of the picture #n of GOP # j decoded immediately before the output. Pause as it is (decode / pause control). At that time, the audio is muted (audio mute control) (step S11).

そして、編集点Aとこの編集点Aと接続される編集点Bとを含む編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))がNより小さいとき(ステッ プS12:Yes)、すなわち、上記(1)、図5(a)の場合には、上記復号画像Jをm−n−1枚符号化する処理を実行する。この場合、符号化処理部2の 複雑度算出部52が後述する複雑度Xpr、Xbrを算出し、符号量割り当て部24がこの複雑度Xpr、Xbrから目標符号量を算出し、符号化部21はこの 目標符号量になるよう符号化処理をする(ステップS13)。   When the total number of pictures (n + (N−m + 1)) included in the edited picture group including the editing point A and the editing point B connected to the editing point A is smaller than N (step S12: Yes), that is, In the case of (1) and FIG. 5A, a process of encoding the decoded image J by mn-1 sheets is executed. In this case, the complexity calculating unit 52 of the encoding processing unit 2 calculates complexity Xpr and Xbr, which will be described later, and the code amount assigning unit 24 calculates the target code amount from the complexity Xpr and Xbr, and the encoding unit 21 Performs an encoding process so as to achieve this target code amount (step S13).

そして、符号化部21が(m−n−1)枚分の復号画像Jを符号化したら、すなわち(m−n−1)枚分の挿入画像である画像Jを挿入したら(ステップ S14:Yes)、編集部3は、符号化部21の符号化を一旦停止させる(エンコード・ポーズ制御)(ステップS15)。すなわち、編集部3は、再符号化ピ クチャ群のピクチャ総数がN枚となるよう、GOP#jのピクチャ#nを復号した画像Jを符号化した挿入ピクチャを、編集点A、Bの間に(m−n−1)枚挿 入させることで、再符号化ピクチャ群のピクチャ総数をN枚とする。このことにより、再符号化ピクチャ群の編集点Aまで及び編集点A以降のピクチャ位相をオ リジナルストリームのピクチャ位相に一致させることができる。   When the encoding unit 21 encodes (m−n−1) decoded images J, that is, when (m−n−1) inserted images J are inserted (step S14: Yes). The editing unit 3 temporarily stops the encoding of the encoding unit 21 (encoding / pause control) (step S15). That is, the editing unit 3 inserts an inserted picture obtained by encoding the image J obtained by decoding the picture #n of the GOP # j between the editing points A and B so that the total number of pictures in the re-encoded picture group is N. The total number of pictures in the re-encoded picture group is set to N by inserting (mn−1) into. As a result, the picture phase up to the edit point A of the re-encoded picture group and the picture phase after the edit point A can be matched with the picture phase of the original stream.

次いで、編集部3は復号処理部4のデコード・ポーズ制御及びオーディオ・ミュート制御を解除し、編集点A以降のGOP#jの残りを復号させる(ステップ S16)。復号処理部4がGOP#jを最後まで復号したら、編集部3は、次に編集点Aと連続される編集点Bを含むGOP#kを復号処理部4へ供給する。復 号処理部4は、編集点Bを含むGOP#kを復号する(ステップS17)。そして、編集点Bの再生時刻になったら(ステップS18:Yes)、編集部3は、 符号化処理部2のエンコード・ポーズ制御を解除する(エンコード・レジューム制御)。これにより、符号化部21は、編集点B以降の復号された画像データの 符号化を開始する(ステップS19)。   Next, the editing unit 3 cancels the decoding / pause control and audio mute control of the decoding processing unit 4, and decodes the rest of the GOP # j after the editing point A (step S16). When the decoding processing unit 4 decodes GOP # j to the end, the editing unit 3 then supplies GOP # k including the editing point B that is continuous with the editing point A to the decoding processing unit 4. The decoding processing unit 4 decodes GOP # k including the editing point B (step S17). When the playback time of the editing point B is reached (step S18: Yes), the editing unit 3 releases the encoding / pause control of the encoding processing unit 2 (encoding / resume control). Thereby, the encoding unit 21 starts encoding the decoded image data after the editing point B (step S19).

次に、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))がNより大きい場合(ステップS12:No、ステップS20:Yes)、すなわち、 上記(2)、図5(b)の場合には、符号化処理部2の複雑度算出部52が後述する複雑度Xir、Xpr、Xbrを算出し、この複雑度複雑度Xir、 Xpr、Xbから符号量割り当て部24が目標符号量を算出し、符号化処理部2はこの目標符号量になるよう符号化処理をする(ステップS21)。   Next, when the total number of pictures (n + (N−m + 1)) included in the edited picture group is larger than N (step S12: No, step S20: Yes), that is, in the case of (2) and FIG. In this case, the complexity calculator 52 of the encoding processor 2 calculates later-described complexity Xir, Xpr, and Xbr, and the code amount allocator 24 calculates the target code amount from the complexity complexity Xir, Xpr, and Xb. Then, the encoding processing unit 2 performs an encoding process so as to achieve this target code amount (step S21).

そして、符号化処理部2が(N−n+m−1)枚分の復号画像Jを符号化したら、すなわち。復号画像Jを符号化した挿入ピクチャを(N−n+m−1)枚挿 入したら(ステップS22:Yes)、上述のステップS15からの処理を実行する。すなわち、編集部3は符号化処理部2のエンコード・ポーズ制御を行い、 復号処理部4にGOP#jの残りの復号をさせ、更にGOP#kの先頭ピクチャから復号を開始させ、そして、編集点Bの再生時刻で符号化処理部2のエンコー ド・レジューム制御を実行する(ステップS15〜S19)。なお、上述したように、復号画像Jを符号化したピクチャを(N−n)枚挿入し、復号画像Kを符 号化したピクチャを(m−1)枚挿入するようにしてもよい。   If the encoding processing unit 2 encodes (N−n + m−1) decoded images J, that is, When (N−n + m−1) inserted pictures obtained by encoding the decoded image J are inserted (step S22: Yes), the processing from step S15 described above is executed. That is, the editing unit 3 performs the encoding / pause control of the encoding processing unit 2, causes the decoding processing unit 4 to decode the remaining GOP # j, further starts decoding from the first picture of GOP # k, and The encoding / resume control of the encoding processing unit 2 is executed at the playback time of point B (steps S15 to S19). As described above, (N−n) pictures encoding the decoded image J may be inserted, and (m−1) pictures encoding the decoded image K may be inserted.

次に、編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))が2N枚である場合(ステップS20:No、ステップS23:Yes)、すなわち、 上記(3)、図6(a)の場合、及び編集ピクチャ群に含まれるピクチャ総数(n+(N−m+1))がN枚である場合(ステップS23:No)、すなわち、 上記(4)、図6(b)の場合には、ステップS25へ進む。ここで、ピクチャ総数(n+(N−m+1))が2N枚の場合(ステップS23:Yes)には、 編集部3は符号化処理部2に指示して編集点Bを含むGOP#kをクローズドGOP化させてもよい。   Next, when the total number of pictures (n + (N−m + 1)) included in the edited picture group is 2N (step S20: No, step S23: Yes), that is, the above (3) and FIG. 6 (a). If the total number of pictures (n + (N−m + 1)) included in the edited picture group is N (step S23: No), that is, in the case of (4) and FIG. Proceed to S25. If the total number of pictures (n + (N−m + 1)) is 2N (step S23: Yes), the editing unit 3 instructs the encoding processing unit 2 to close GOP # k including the editing point B. You may make it GOP.

以上、2パス・エンコードする編集ピクチャ群のピクチャ総数(n+(N−m+1))の枚数に応じて編集部3は復号処理部4、符号化処理部2を適宜制御す る。編集点がない場合には、復号処理部4は編集部3から供給されるプレイリストで指定されるGOPを復号し、符号化処理部2は、復号された画像を順次 MPEG符号化していく。こうして復号処理部4がプレイリストの最終GOPを復号し、符号化処理部2がこれを符号化したら(ステップS25:Yes)、編 集部3は符号化処理部2のエンコードを終了させる(ステップS26)。   As described above, the editing unit 3 appropriately controls the decoding processing unit 4 and the encoding processing unit 2 according to the total number of pictures (n + (N−m + 1)) of the edited picture group to be two-pass encoded. If there is no edit point, the decoding processing unit 4 decodes the GOP specified by the playlist supplied from the editing unit 3, and the encoding processing unit 2 sequentially MPEG-decodes the decoded images. Thus, when the decoding processing unit 4 decodes the final GOP of the playlist and the encoding processing unit 2 encodes it (step S25: Yes), the editing unit 3 ends the encoding of the encoding processing unit 2 (step S25). S26).

本実施の形態においては、このように、必要に応じて単色画像を符号化したピクチャ又は編集点直前または直後のピクチャを復号した復号画像を挿入すること で、編集点A以前、及び/又は編集点B以降のエンコード後のピクチャ位相をオリジナルストリームのピクチャ位相と一致させることができる。このことによ り、オリジナルストリームの符号化の際に解析された複雑度を引用し、目標符号量を設定して2パス・エンコードを可能とする。   In the present embodiment, as described above, by inserting a picture obtained by encoding a monochrome image or a decoded picture obtained by decoding a picture immediately before or after the editing point as necessary, editing before the editing point A and / or editing is performed. The encoded picture phase after point B can be matched with the picture phase of the original stream. As a result, the complexity analyzed at the time of encoding the original stream is cited, and the target code amount is set to enable two-pass encoding.

ここで、2パス・エンコードを可能とするため、復号処理部4をポーズ・制御し、例えば図5に示す復号画像Jを1又は複数枚挿入することでピクチャ位相を 揃えるが、この際、挿入画像(復号画像J、K、単色画像など)を符号化したピクチャは、オリジナルストリームにはないものであるため、複雑度も引用するこ とができない。そこで、本実施の形態においては、この挿入画像の複雑度を、元の符号化ストリームの複雑度から推定算出する。   Here, in order to enable two-pass encoding, the decoding processing unit 4 is paused and controlled, and, for example, one or a plurality of decoded images J shown in FIG. 5 are inserted to align the picture phase. Since a picture obtained by encoding an image (decoded image J, K, monochrome image, etc.) is not in the original stream, the complexity cannot be cited. Therefore, in the present embodiment, the complexity of the inserted image is estimated and calculated from the complexity of the original encoded stream.

次に、符号化処理部2の符号量割り当て部における目標符号量を算出する方法、及びオリジナルストリームには存在しない挿入画像を符号化する際の複雑度の 算出方法について説明する。図10、図11は、複雑度を用いて目標符号量を算出する方法を示すフローチャート、図12は、挿入するピクチャの複雑度を算出 する方法を示すフローチャートである。   Next, a method for calculating the target code amount in the code amount assigning unit of the encoding processing unit 2 and a method for calculating the complexity when encoding an inserted image that does not exist in the original stream will be described. 10 and 11 are flowcharts showing a method for calculating the target code amount using the complexity, and FIG. 12 is a flowchart showing a method for calculating the complexity of the picture to be inserted.

フレームfの符号化までに、入力された復号画像の解析ができるフレーム数をLaとする。図12に示すように、複雑度算出部52は、先ず、プレイリストか ら編集点の総数、編集点を含むGOP位置、編集点のピクチャ位置を取得する(ステップS31)。符号量割り当て部24は、入力された復号画像のフレーム番 号fを−La+1と初期化する(ステップS32)   Let La be the number of frames in which the input decoded image can be analyzed before encoding the frame f. As shown in FIG. 12, the complexity calculator 52 first obtains the total number of edit points, the GOP position including the edit points, and the picture position of the edit points from the playlist (step S31). The code amount assigning unit 24 initializes the frame number f of the input decoded image to -La + 1 (step S32).

そして、複雑度算出部52は、プレイリストに従って順次GOPの複雑度X[s,t]を読み込んでいく(ステップS33)。オリジナルストリームST0の 複雑度は、予め解析され、例えばオリジナルストリームST0と共に保存されている。ここで、複雑度[s,t]は、オリジナルストリームST0における GOP#s(1≦s≦S)のピクチャ#t(1≦t≦N)の複雑度を示すものとする。   Then, the complexity calculator 52 sequentially reads the GOP complexity X [s, t] in accordance with the playlist (step S33). The complexity of the original stream ST0 is analyzed in advance and stored together with the original stream ST0, for example. Here, the complexity [s, t] indicates the complexity of the picture #t (1 ≦ t ≦ N) of GOP # s (1 ≦ s ≦ S) in the original stream ST0.

そして、編集点Aの直前ピクチャの複雑度X[s,t]=X[#j,#n]まで読み込んだら(ステップS34:Yes)、本実施の形態においては、以降に 必要に応じて位相を揃えるための挿入画像が挿入される。よって、編集点間に挿入される挿入画像の複雑度を算出する(ステップS35)。この詳細は、図12 を参照して後述する。   Then, after reading up to the complexity X [s, t] = X [#j, #n] of the picture immediately before the edit point A (step S34: Yes), in this embodiment, the phase is subsequently changed as necessary. An insertion image for aligning is inserted. Therefore, the complexity of the inserted image inserted between the edit points is calculated (step S35). Details of this will be described later with reference to FIG.

複雑度算出部52は、入力されたフレームfがフレーム数Laを満たすか否かを判断する(ステップS36)。入力された画像のフレーム枚数がフレーム数 La未満である場合(すなわち−La+1に初期化された画像のフレーム番号fがf<0の場合)、複雑度算出部52は、fの値をインクリメントし(ステップ S38)、次の画像の複雑度を読み出す。   The complexity calculator 52 determines whether or not the input frame f satisfies the frame number La (step S36). When the number of frames of the input image is less than the frame number La (that is, when the frame number f of the image initialized to −La + 1 is f <0), the complexity calculation unit 52 increments the value of f. (Step S38), the complexity of the next image is read out.

一方、入力された画像のフレーム枚数がフレーム数Laと同じになった場合(j=0)、複雑度算出部52は、フレームfが符号化処理を行う単位区間Cの倍数であるか否かを判断する(ステップS37)。   On the other hand, when the number of frames of the input image becomes the same as the frame number La (j = 0), the complexity calculating unit 52 determines whether or not the frame f is a multiple of the unit interval C in which the encoding process is performed. Is determined (step S37).

フレームfが符号処理を行う単位区間Cの倍数でない場合、複雑度算出部52はフレームfの値をインクリメントし(ステップS38)、次の画像の複雑度を読み出す。   If the frame f is not a multiple of the unit interval C on which the encoding process is performed, the complexity calculation unit 52 increments the value of the frame f (step S38), and reads the complexity of the next image.

一方、フレームfが符号化処理を行う単位区間Cの整数倍である場合、符号割当て部24は、符号量割り当て区間Cに対し符号量を割当てる。   On the other hand, when the frame f is an integral multiple of the unit interval C in which the encoding process is performed, the code allocation unit 24 allocates a code amount to the code amount allocation interval C.

先ず、割当て区間内の総符号量Raを、2パス目の符号化処理のビットレートに基づき算出する。この際、バッファ占有量BOC[f]を考慮して、総符号量を調整することも可能である。(ステップS39)   First, the total code amount Ra in the allocation interval is calculated based on the bit rate of the second pass encoding process. At this time, it is also possible to adjust the total code amount in consideration of the buffer occupation amount BOC [f]. (Step S39)

次に、符号量割当て部24は、各フレームの目標符号量を計算する。各フレームの目標符号量T[f]は、符号量の割当て区間に割当てることができる総符号量Ra[f]を複雑度X[s,t]で比例配分し、
T[f]=(X[s,t]/Xsum)*R[f]
と算出することができる。ここでXsumは割当て区間の複雑度X[s,t]の総和を示す。目標符号量T[f]は、フレームfからフレームf+L−1までの各々について計算する(ステップS41)。
Next, the code amount allocation unit 24 calculates a target code amount of each frame. For the target code amount T [f] of each frame, the total code amount Ra [f] that can be allocated to the code amount allocation section is proportionally distributed with the complexity X [s, t].
T [f] = (X [s, t] / Xsum) * R [f]
Can be calculated. Here, Xsum represents the total sum of the complexity X [s, t] of the allocation section. The target code amount T [f] is calculated for each of the frame f to the frame f + L−1 (step S41).

続いて、符号量割り当て部24は、割当てられた目標符号量の符号化バッファ22におけるバッファ占有量を計算する(ステップS41)。例えば、バッファ占有量をBOC[f]は、
BOC[f]=BOC[f−1]+T[f]−Rframe
と計算することができる。ここでRframeは、本符号化で使うビットレートRから計算されたフレームあたりの符号量を示す。また、バッファ占有量の初期値BOC[0]=0とする
Subsequently, the code amount allocation unit 24 calculates the buffer occupation amount in the encoding buffer 22 of the allocated target code amount (step S41). For example, the buffer occupancy is BOC [f]
BOC [f] = BOC [f−1] + T [f] −Rframe
And can be calculated. Here, Rframe indicates the code amount per frame calculated from the bit rate R used in the main encoding. In addition, the buffer occupancy initial value BOC [0] = 0 is set.

そして、符号量割り当て部24は、計算したバッファ占有量BOC[f]に基づき、符号化バッファ22がオーバーフロー又はアンダーフローを起こすか否か を判断する。例えば、符号化バッファの上限をBとした場合、バッファ占有量BOC[j]がB−Rframeより小さいか否かを判断する。   Then, the code amount allocation unit 24 determines whether or not the encoding buffer 22 causes an overflow or underflow based on the calculated buffer occupancy BOC [f]. For example, when the upper limit of the encoding buffer is B, it is determined whether or not the buffer occupation amount BOC [j] is smaller than B-Rframe.

符号化バッファがアンダーフローを起こしている場合(ステップS42:Yes)、符号量割り当て部24は、符号化バッファ22がアンダーフローを起こさ ないように符号量を調節する(ステップS43)。例えば、符号化バッファ22の符号占有量が最小となるフレームfuを検出し、フレームfからfuまでに割 当てた符号を、fuで符号化バッファがアンダーフローを起こさないように割当てを増加させる。そして、増加させた分の符号量は、fu+1からf+L−1の フレームに割当てた符号量から減少させる。   If the encoding buffer has underflowed (step S42: Yes), the code amount allocation unit 24 adjusts the code amount so that the encoding buffer 22 does not cause an underflow (step S43). For example, the frame fu that minimizes the code occupation amount of the encoding buffer 22 is detected, and the allocation of the codes allocated from the frames f to fu is increased so that the encoding buffer does not underflow at fu. Then, the increased code amount is reduced from the code amount allocated to the frames from fu + 1 to f + L−1.

また、符号化バッファがオーバーフローを起こしている場合(ステップS44:Yes)、符号量割り当て部24は、符号化バッファ22がオーバーフローを 起こさないように符号量を調節する。例えば、符号化バッファの符号量の占有量が最大となるフレームfoを検出し、フレームfからfoまでに割当てた符号量 を、foで符号化バッファがオーバーフローを起こさないよう符号量の割当てを減少させる。そして、減少させた分の符号量は、fo+1からf+L−1のフ レームに割当てる(ステップS45)   When the encoding buffer has overflowed (step S44: Yes), the code amount allocation unit 24 adjusts the code amount so that the encoding buffer 22 does not overflow. For example, the frame fo with the largest code buffer occupation amount is detected, and the code amount allocated from frames f to fo is reduced, so that the code buffer allocation is reduced so that the buffer does not overflow at fo. Let The reduced code amount is allocated to frames from fo + 1 to f + L−1 (step S45).

また、符号化バッファ22でオーバーフロー又はアンダーフローのいずれも起こさない、適切な割当てとなっている場合(ステップS42:No、ステップ S44:No)、符号化部21は、割り当て区間Cの符号化を行う(ステップS46)。そして、ステップS38へ進み、フレームfの値をインクリメントし (ステップS38)、複雑度算出部52は次の画像の複雑度を読み出し、上述の処理を繰り返す。   In addition, when the allocation is an appropriate allocation that does not cause any overflow or underflow in the encoding buffer 22 (step S42: No, step S44: No), the encoding unit 21 encodes the allocation section C. This is performed (step S46). Then, the process proceeds to step S38, the value of the frame f is incremented (step S38), and the complexity calculation unit 52 reads the complexity of the next image and repeats the above-described processing.

次に、挿入画像Jの複雑度を算出する処理について説明する。図12に示すように、先ず、再符号化ピクチャ群の総数n+(N−m+1)がNより小さいか否 かを判定する(ステップS51)。小さい場合には、s=j、t=n+1にセットし(ステップS52)、t=m−1に達するまで(ステップS53)、順次複 雑度X[s,t]を算出する(ステップS54)。   Next, a process for calculating the complexity of the inserted image J will be described. As shown in FIG. 12, first, it is determined whether or not the total number n + (N−m + 1) of re-encoded pictures is smaller than N (step S51). If it is smaller, s = j and t = n + 1 are set (step S52), and the complexity X [s, t] is sequentially calculated until t = m-1 is reached (step S53) (step S54). .

ここで、t=n〜m−1までの間は、同一の復号画像Jを符号化する処理である。すなわち、この場合には、上述したように、編集点Aにおいて、復号画像J がポーズ表示され、これを符号化処理するため、1パス・エンコードのオリジナルストリームには存在しない新た画像を挿入することになる。このため、1パス 目の符号化処理では、この画像の複雑度が求められていない。よって、このままでは、ピクチャ毎の目標符号量を算出することができない。   Here, the period from t = n to m−1 is a process of encoding the same decoded image J. That is, in this case, as described above, at the editing point A, the decoded image J is displayed as a pause, and a new image that does not exist in the original stream of 1-pass encoding is inserted to encode this. become. For this reason, the complexity of the image is not required in the first pass encoding process. Therefore, the target code amount for each picture cannot be calculated as it is.

ところで、この挿入画像はt=nにおける復号画像Jである。そこで本実施の形態においては、復号画像Jの複雑度X[#j,#n]に基づき、復号画像Jを符号化するピクチャタイプに応じて算出する。すなわち、をPピクチャに符号化するのであれば、
複雑度Xpr=X[#j,#n]/Dp
とし、Bピクチャに符号化するのであれば、
複雑度Xbr=X[#j,#n]/Db
として算出する。
ここで、Dpは、Pピクチャに符号化する際の複雑度を算出するための定数、Dbは、Bピクチャに符号化する際の複雑度を算出するための定数を示す。
By the way, this inserted image is a decoded image J at t = n. Therefore, in the present embodiment, calculation is performed based on the complexity X [#j, #n] of the decoded image J according to the picture type for encoding the decoded image J. That is, if you want to encode a P picture,
Complexity Xpr = X [#j, #n] / Dp
And if it is encoded into a B picture:
Complexity Xbr = X [#j, #n] / Db
Calculate as
Here, Dp is a constant for calculating the complexity when encoding into a P picture, and Db is a constant for calculating the complexity when encoding into a B picture.

ここで、0<Dp≦Dbであり、例えばXpr=X[#j,#n]/3、Xbr=X[#j,#n]/10等とすることができる。このDp、Dbは、1パ ス・エンコード時に同ピクチャの繰り返し箇所があれば、それの複雑度を参照してもよい。また、挿入される(m−n−1)枚分のピクチャは、編集点B以降の 位相を揃えるために挿入するものであり、必ずしもこの(m−n−1)枚のピクチャは、オリジナルストリームにおけるt=n+1〜m−1までのピクチャタイ プと同一である必要はない。編集点A以前又は編集点B以降に割り当てる符号量を増加したい場合には、オリジナルストリームよりBピクチャを増やし、挿入ピ クチャの複雑度を小さくするなどしてもよい。   Here, 0 <Dp ≦ Db, for example, Xpr = X [#j, #n] / 3, Xbr = X [#j, #n] / 10, or the like. For Dp and Db, if there is a repeated portion of the same picture during one-pass encoding, the complexity thereof may be referred to. The (mn-1) pictures to be inserted are inserted in order to align the phases after the editing point B, and the (mn-1) pictures are not necessarily the original stream. Need not be the same as t = n + 1 to m−1 picture types. If it is desired to increase the amount of code allocated before edit point A or after edit point B, the B picture may be increased from the original stream to reduce the complexity of the inserted picture.

なお、ここでは、挿入画像をt=nにおける復号画像Jとして説明したが、上述したように、挿入画像としてs=k、t=mにおける復号画像Kを使用するこ ともできる。すなわち、GOP#kのピクチャ#mを復号した復号画像Kの複雑度X[#k,#m]に基づき、挿入画像の複雑度を上記と同様に算出することも 可能である。   Here, the inserted image is described as the decoded image J at t = n, but as described above, the decoded image K at s = k and t = m can also be used as the inserted image. That is, the complexity of the inserted image can be calculated in the same manner as described above based on the complexity X [#k, #m] of the decoded image K obtained by decoding the picture #m of GOP # k.

更に、復号画像J又は復号画像Kのオリジナルストリームにおけるピクチャタイプに応じて、Dp、Dbの値を適宜調整することも可能である。例えば復号画 像J又は復号画像KがオリジナルストリームST0においてIピクチャである場合には、Dp、Dbを大きくし、Bピクチャである場合にはDp、Dbを相対的 に小さくしたりしてもよい。すなわち、上記の例では、Dp=3、Db=10として説明したが、復号画像J又は復号画像Kのピクチャタイプ等に応じ、 Dp=1/3、Db=1など設定し、復号画像J又は復号画像Kを符号化する際の複雑度と同等以上の複雑度とすることも可能である。   Further, the values of Dp and Db can be appropriately adjusted according to the picture type in the original stream of the decoded image J or the decoded image K. For example, when the decoded image J or the decoded image K is an I picture in the original stream ST0, Dp and Db may be increased, and when it is a B picture, Dp and Db may be relatively decreased. . That is, in the above example, Dp = 3 and Db = 10 are described. However, according to the picture type of the decoded image J or the decoded image K, Dp = 1/3, Db = 1, etc. are set, and the decoded image J or It is also possible to set the complexity equal to or higher than the complexity at the time of encoding the decoded image K.

そして、tを順次インクリメントし(ステップS55)、t=mとなったら、挿入ピクチャ総数=m−n−1(枚)、すなわち、挿入画像のフレーム分(m−n−1)、fを増加させてフレームf=f+(m−n−1)とし(ステップS56)、図10のステップS36へ進む。   Then, t is sequentially incremented (step S55), and when t = m, the total number of inserted pictures = mn−1 (sheets), that is, the number of frames of the inserted image (mn−1) and f are increased. Thus, the frame f = f + (mn-1) is set (step S56), and the process proceeds to step S36 in FIG.

また、再符号化ピクチャ群の総数n+(N−m+1)がNより大きく2Nより小さい場合には(ステップS57)、先ずs=j、t=n+1にセットし(ス テップS58)、t=Nに達するまで(ステップS59)、tをインクリメントしながら上述のステップS54と同様の方法で複雑度Xpr、Xbrを算出する (ステップS60、S61)。   When the total number n + (N−m + 1) of re-encoded pictures is larger than N and smaller than 2N (step S57), first, s = j and t = n + 1 are set (step S58), and t = N. (Step S59), the complexity levels Xpr and Xbr are calculated in the same manner as in step S54 described above while incrementing t (steps S60 and S61).

そして、t=Nより大きくなったらs=k、t=1にセットし(ステップS62)、tがmに達するまで(ステップS63)、tをインクリメントしながら複 雑度X[s,t]を算出する(ステップS64、S65)。ここで、s=k、t=1に配置されるピクチャは、GOPの先頭ピクチャであるため、Iピクチャと される。このIピクチャも復号画像Jの静止画像であるが、Iピクチャであるので、その符号量は他のPピクチャ、Bピクチャより多く割り当てられる必要があ る。よって、Iピクチャとなるs=k、t=1における複雑度X[#k,#1]は、オリジナルストリームST0の複雑度X[#k,#1]をそのまま参照す る。t=1以降のPピクチャ、Bピクチャは、上記と同様、複雑度Xpr=X[#j,#n]/Dp、複雑度Xbr=X[#j,#n]/Dbとして算出する。 こうしてt=mに達したら、挿入ピクチャ総数=(N−n)+m−1(枚)、すなわち、挿入画像のフレーム分(N−n)+m−1、fを増加させてフレーム f=f+(N−n)+m−1とし(ステップS66)、図10のステップS36へ進む。   When t is greater than N, s = k and t = 1 are set (step S62). Until t reaches m (step S63), the complexity X [s, t] is incremented while incrementing t. Calculate (steps S64 and S65). Here, since the picture arranged at s = k and t = 1 is the first picture of the GOP, it is set as an I picture. This I picture is also a still picture of the decoded picture J, but since it is an I picture, it is necessary to allocate a larger amount of code than other P pictures and B pictures. Therefore, the complexity X [#k, # 1] at s = k, t = 1 as an I picture refers to the complexity X [#k, # 1] of the original stream ST0 as it is. P pictures and B pictures after t = 1 are calculated as complexity Xpr = X [#j, #n] / Dp and complexity Xbr = X [#j, #n] / Db, as described above. When t = m is reached in this way, the total number of inserted pictures = (N−n) + m−1 (sheets), that is, (N−n) + m−1, f are increased by the number of frames of the inserted image, and the frame f = f + ( N−n) + m−1 (step S66), and the process proceeds to step S36 in FIG.

なお、図10乃至図12の処理のタイミングは、符号化処理部2における図8、図9に示す2パス・エンコード時、各フレーム(復号画像)の符号化に先行して、その目標符号量が算出できればよい。   The timing of the processing in FIGS. 10 to 12 is the target code amount prior to encoding of each frame (decoded image) in the 2-pass encoding shown in FIGS. 8 and 9 in the encoding processing unit 2. Can be calculated.

本実施の形態によれば、オリジナルストリームからフレーム(ピクチャ)単位で編集した編集済のタイトル(プレイリスト)において、編集点前後のピクチャ 位相をオリジナルストリームST0のピクチャ位相と一致させることができる。したがって、ビットレートを下げて再符号化しても画質の劣化を最小限とするこ とができる。更に、オリジナルストリームを符号化する際に解析して複雑度を求めておけば、これを参照することができ、この複雑度に基づき目標符号量を算出 して2パス・エンコードした編集済み符号化ストリームST1を得ることができる。よって、例えば記憶容量の大きいHDD等に録画された高ビットレートのオ リジナルストリームをピクチャ単位で編集しても、2パス・エンコードにより画質の劣化を最低限に抑制しつつ記憶容量の小さいDVD等に記録(ダビング)す るための編集済み符号化ストリームST1を生成することができる。   According to the present embodiment, in the edited title (playlist) edited from the original stream in units of frames (pictures), the picture phase before and after the editing point can be matched with the picture phase of the original stream ST0. Therefore, even if the bit rate is lowered and re-encoding is performed, the degradation of image quality can be minimized. Furthermore, if the complexity is obtained by analysis when the original stream is encoded, it can be referred to, and the target code amount is calculated based on this complexity and the edited encoding is performed by two-pass encoding. Stream ST1 can be obtained. Therefore, for example, even if a high-bit-rate original stream recorded on a HDD with a large storage capacity is edited on a picture-by-picture basis, a DVD with a small storage capacity while minimizing image quality degradation by two-pass encoding. It is possible to generate an edited encoded stream ST1 for recording (dubbing).

すなわち、編集点間においては、編集点直前の復号画像を符号化し、所望のフレーム(挿入画像)を挿入することで、編集点においてGOP境界に跨ぐピク チャ位相を維持することが可能となる。更に、挿入フレームは、ポーズ表示中の編集点直前の復号画像であるため、当該復号画像を符号化する際の複雑度Xを、 オリジナルストリームにて得られる複雑度のDp又はDb分の1として決定することが可能となる。以上の処理によって、編集済み符号化ストリームST1を生 成する際の各ピクチャの複雑度が得られるため、2パス・エンコード処理が可能となる。   That is, between the edit points, the picture phase straddling the GOP boundary can be maintained at the edit point by encoding the decoded image immediately before the edit point and inserting a desired frame (inserted image). Furthermore, since the inserted frame is a decoded image immediately before the editing point in the pause display, the complexity X when encoding the decoded image is set to 1 / Dp or Db of the complexity obtained in the original stream. It becomes possible to decide. With the above processing, the complexity of each picture when the edited encoded stream ST1 is generated can be obtained, so that two-pass encoding processing is possible.

なお、本発明は上述した実施の形態のみに限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。例え ば、上述の実施の形態において、図1乃至図3に示す各ブロックにおける任意の処理を、CPU(Central Processing Unit)にコンピュータプログラムを実行させることにより実現することも可能である。この場合、コンピュータプログラムは、記録媒体に記録して提供する ことも可能であり、また、インターネットその他の伝送媒体を介して伝送することにより提供することも可能である。   It should be noted that the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the present invention. For example, in the above-described embodiment, arbitrary processing in each block shown in FIGS. 1 to 3 can be realized by causing a CPU (Central Processing Unit) to execute a computer program. In this case, the computer program can be provided by being recorded on a recording medium, or can be provided by being transmitted via the Internet or another transmission medium.

2 符号化処理部
3 編集部
4 復号処理部
5 表示部
6,7 ストレージI/F
21 符号化部
22 符号化バッファ
23 解析部
24 符号割当て部
25 符号量制御部
26 ポーズ/レジューム制御部
30,40 記憶装置
51 特徴量観測部
52 複雑度算出部
61 復号部
62 復号バッファ
63 ポーズ/レジューム制御部
2 Encoding processing unit 3 Editing unit 4 Decoding processing unit 5 Display units 6 and 7 Storage I / F
21 encoding unit 22 encoding buffer 23 analysis unit 24 code allocation unit 25 code amount control unit 26 pause / resume control unit 30, 40 storage device 51 feature amount observation unit 52 complexity calculation unit 61 decoding unit 62 decoding buffer 63 pause / Resume control unit

Claims (4)

入力されるフレームのそれぞれを符号化した符号化データを出力する符号化処理部と、
前記符号化データを復号して、再生されるべきフレームのそれぞれを含む復号データを出力する復号処理部と、
を有し、
前記復号データが含む再生されるべき前記フレームのそれぞれの再生の態様を変更する編集が行われる場合には、
前記復号処理部は前記復号データが含む再生されるべき前記フレームのそれぞれに前記編集に応じたフレームを挿入してなる編集済みの復号データを出力し、
前記符号化処理部は、入力される前記フレームのそれぞれと、編集済みの前記復号データに含まれ入力される前記フレームのそれぞれに対応するフレームとが同じピクチャタイプで符号化されるように、編集済みの前記復号データを符号化することを特徴とする画像処理装置。
An encoding processing unit that outputs encoded data obtained by encoding each of the input frames;
A decoding processor that decodes the encoded data and outputs decoded data including each of the frames to be reproduced;
Have
When editing is performed to change the playback mode of each of the frames to be played back included in the decoded data,
The decoding processing unit outputs edited decoded data obtained by inserting a frame corresponding to the editing into each of the frames to be reproduced included in the decoded data,
The encoding processing unit edits each of the input frames and a frame corresponding to each of the input frames included in the edited decoded data so as to be encoded with the same picture type. An image processing apparatus, wherein the decoded data is encoded.
前記復号データが含む再生されるべき前記フレームの内の第1のフレームと、前記一のフレームより二つ以上、再生される順序が後である第2のフレームとをつなぎ合わせる前記編集が行われる場合には、
前記復号処理部は前記第1のフレームと前記第2のフレームの間に所定数のフレームを挿入することを特徴とする請求項1に記載の画像処理装置。
The editing is performed such that the first frame of the frames to be played back included in the decoded data is connected to the second frame having a playback order that is two or more later than the one frame. in case of,
The image processing apparatus according to claim 1, wherein the decoding processing unit inserts a predetermined number of frames between the first frame and the second frame.
前記復号データが含む再生されるべき前記フレームの内の先頭のフレームより再生される順序が後のフレームである第3フレームを、先頭のフレームに変更する前記編集が行われる場合には、
前記復号処理部は、前記第3のフレームの前に所定数のフレームを挿入することを特徴とする請求項1又は2に記載の画像処理装置。
In the case where the editing is performed in which the third frame, which is a frame subsequent to the first frame in the frame to be reproduced included in the decoded data, is changed to the first frame,
The image processing apparatus according to claim 1, wherein the decoding processing unit inserts a predetermined number of frames before the third frame.
前記復号データが含む再生されるべき前記フレームの内の最後のフレームより再生される順序が前のフレームである第4フレームを、最後のフレームに変更する前記編集が行われる場合には、
前記復号処理部は、前記第4のフレームの後に所定数のフレームを挿入することを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。
In the case where the editing is performed in which the fourth frame, which is the previous frame in the playback order of the last frame included in the decoded data included in the decoded data, is changed to the last frame,
The image processing apparatus according to claim 1, wherein the decoding processing unit inserts a predetermined number of frames after the fourth frame.
JP2010166173A 2010-07-23 2010-07-23 Image coding apparatus, image coding method, and image editing apparatus Pending JP2010252394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010166173A JP2010252394A (en) 2010-07-23 2010-07-23 Image coding apparatus, image coding method, and image editing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010166173A JP2010252394A (en) 2010-07-23 2010-07-23 Image coding apparatus, image coding method, and image editing apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2005289912A Division JP4791129B2 (en) 2005-10-03 2005-10-03 Image coding apparatus, image coding method, and image editing apparatus

Publications (1)

Publication Number Publication Date
JP2010252394A true JP2010252394A (en) 2010-11-04

Family

ID=43314104

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010166173A Pending JP2010252394A (en) 2010-07-23 2010-07-23 Image coding apparatus, image coding method, and image editing apparatus

Country Status (1)

Country Link
JP (1) JP2010252394A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1098713A (en) * 1996-09-20 1998-04-14 Sony Corp Video signal switch device
JPH10271496A (en) * 1997-03-21 1998-10-09 Nippon Telegr & Teleph Corp <Ntt> Processing method for coded and decoded image
JPH11341435A (en) * 1998-05-22 1999-12-10 Sony Corp Edit method and edit device
JP2002232882A (en) * 2001-01-31 2002-08-16 Nec Corp Moving picture encoder using a priori analysis, moving picture encoding method, and its program
JP2002300528A (en) * 2001-03-30 2002-10-11 Toshiba Corp Method and device for editing video stream
JP2004165894A (en) * 2002-11-12 2004-06-10 Kddi Corp Bit rate control method for encoder

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1098713A (en) * 1996-09-20 1998-04-14 Sony Corp Video signal switch device
JPH10271496A (en) * 1997-03-21 1998-10-09 Nippon Telegr & Teleph Corp <Ntt> Processing method for coded and decoded image
JPH11341435A (en) * 1998-05-22 1999-12-10 Sony Corp Edit method and edit device
JP2002232882A (en) * 2001-01-31 2002-08-16 Nec Corp Moving picture encoder using a priori analysis, moving picture encoding method, and its program
JP2002300528A (en) * 2001-03-30 2002-10-11 Toshiba Corp Method and device for editing video stream
JP2004165894A (en) * 2002-11-12 2004-06-10 Kddi Corp Bit rate control method for encoder

Similar Documents

Publication Publication Date Title
JP4791129B2 (en) Image coding apparatus, image coding method, and image editing apparatus
JP4045553B2 (en) Editing apparatus, editing method, re-encoding apparatus, re-encoding method, splicing apparatus, and splicing method
US6642967B1 (en) Video data formatting and storage employing data allocation to control transcoding to intermediate video signal
KR101119685B1 (en) Information processing apparatus, information processing method, and recording medium
JPH10145798A (en) System for processing digital coding signal
US6256451B1 (en) Apparatus and method of editing video data
JP2007300593A (en) Information processing apparatus and information processing method, recording medium, and program
JP4743119B2 (en) Information processing apparatus, information processing method, recording medium, and program
US20070263731A1 (en) Moving Picture Re-Encoding Apparatus, Moving Picture Editing Apparatus, Program, and Recording Medium
JPH08251582A (en) Encoded data editing device
JP4301237B2 (en) Encoding apparatus and method thereof, recording apparatus and method thereof, and recording medium
JP3918332B2 (en) Multiplexer, multiplexing method, and recording medium
JP2010252394A (en) Image coding apparatus, image coding method, and image editing apparatus
JP2003052040A (en) Mpeg data reproduction equipment
JP2008258858A (en) Moving image coding device
JP4416845B2 (en) Encoding apparatus and method thereof, and recording apparatus and method thereof
JPH1198514A (en) Image coder and its method
JP3897783B2 (en) Image processing apparatus, control method therefor, computer program, and computer-readable storage medium
JP4295658B2 (en) Re-encoding device
JP2008066845A (en) Information processing apparatus and method, recording medium, and program
GB2353654A (en) Processing GOPs to be stored as all I-frames
JP2011040827A (en) Video recording/reproducing device, and video clip processing method
JP2000316158A (en) Encoding device and its method
WO2011129059A1 (en) Information processing device and information processing method
JP2008066852A (en) Information processor and information processing method, recording medium, and program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121016

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121017

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130305