JP2008066852A - Information processor and information processing method, recording medium, and program - Google Patents

Information processor and information processing method, recording medium, and program Download PDF

Info

Publication number
JP2008066852A
JP2008066852A JP2006240302A JP2006240302A JP2008066852A JP 2008066852 A JP2008066852 A JP 2008066852A JP 2006240302 A JP2006240302 A JP 2006240302A JP 2006240302 A JP2006240302 A JP 2006240302A JP 2008066852 A JP2008066852 A JP 2008066852A
Authority
JP
Japan
Prior art keywords
stream
video signal
encoded stream
encoding
code amount
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.)
Withdrawn
Application number
JP2006240302A
Other languages
Japanese (ja)
Inventor
Hideki Arai
秀喜 新井
Eiji Ueki
英治 植木
Kaoru Nochida
薫 後田
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2006240302A priority Critical patent/JP2008066852A/en
Publication of JP2008066852A publication Critical patent/JP2008066852A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To securely record an insert-edited stream even if the remaining recording capacity of a recording medium is small. <P>SOLUTION: The number of clusters calculating unit calculates the numbers of clusters to be allocated to a stream C2 and a stream D2 in a re-encoding section from the number of clusters from a position α2 to a position δ2 of a stream A2 and the number of clusters from a position β2 to a position γ2 of a stream B2 inserted into the stream A2. A code amount calculating unit calculates a target code amount of re-encoding so that the streams C2 and D2 can be recorded in the respectively allocated number of clusters. An encoding control unit controls re-encoding of the stream C2 and stream D2 so that the code amount reaches the calculated code amount. The present invention is applicable to an editing device which edits an image. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は情報処理装置および方法、記録媒体、並びにプログラムに関し、特に、記録メディアに記録された圧縮映像データに対するインサート編集を行う場合において好適な情報処理装置および方法、記録媒体、並びにプログラムに関する。   The present invention relates to an information processing apparatus and method, a recording medium, and a program, and more particularly to an information processing apparatus and method, a recording medium, and a program that are suitable for performing insert editing on compressed video data recorded on a recording medium.

MPEG(Moving Picture Coding Experts Group/Moving Picture Experts Group)などに代表される画像圧縮方式では、フレーム間予測を用いて映像信号を圧縮符号化することで、高い圧縮効率を実現している。   In an image compression method represented by MPEG (Moving Picture Coding Experts Group / Moving Picture Experts Group) or the like, high compression efficiency is realized by compressing and encoding a video signal using inter-frame prediction.

例えばMPEGにおいて、Iピクチャ、Pピクチャ、およびBピクチャから構成される双方向のフレーム間予測を用いた圧縮符号化方式は、Long GOP(Group of Picture)方式の圧縮と呼ばれている。   For example, in MPEG, a compression coding method using bidirectional inter-frame prediction composed of an I picture, a P picture, and a B picture is called Long GOP (Group of Picture) compression.

ここで、Iピクチャとは、フレーム内(Intra)符号化画像のことであり、他の画面とは独立に符号化されるピクチャであり、この情報のみで画像を復号することができるものである。Pピクチャとは、フレーム間(inter)順方向予測符号化画像のことであり、時間的に前(順方向)のフレームからの差分によって表現される前方向予測符号化ピクチャである。また、Bピクチャとは、双方向予測符号化画像のことであり、時間的に前(順方向)、または後(逆方向)、または前後(双方向)のピクチャを利用して動き補償フレーム間予測により符号化されるピクチャである。   Here, an I picture is an intra-frame (Intra) coded image, which is a picture that is coded independently of other screens, and can be decoded only with this information. . A P picture is an inter-frame (inter) forward predictive encoded image, and is a forward predictive encoded picture represented by a difference from a temporally previous (forward) frame. A B picture is a bi-directional predictive encoded image, and is used between motion compensation frames using temporally forward (forward), backward (reverse), or forward / backward (bidirectional) pictures. It is a picture encoded by prediction.

従来、Long GOP方式で圧縮(エンコード)されたストリームをカット編集する方法が提案されており、そのようなカット編集においては、図1に示すように、ストリームA1とストリームB1とが編集点において接続される(例えば、特許文献1参照)。   Conventionally, a method of cut editing a stream compressed (encoded) by the Long GOP method has been proposed. In such cut editing, as shown in FIG. 1, a stream A1 and a stream B1 are connected at an editing point. (See, for example, Patent Document 1).

なお、図中、Pa1およびPb1はそれぞれ、ストリームA1およびストリームB1における編集点を示しており、図中、縦方向の線は、それぞれのストリームにおけるGOPの切れ目を示している。   In the figure, Pa1 and Pb1 indicate edit points in the stream A1 and the stream B1, respectively. In the figure, the vertical line indicates a GOP break in each stream.

図1の例においては、ストリームA1の編集点Pa1を含むGOPの開始位置α1から編集点Pa1までの部分と、ストリームB1の編集点Pb1から、その編集点Pb1を含むGOPの終了位置β1までの部分がデコードされて接続され、ストリームC1とされる。そして、接続されて得られたストリームC1は再エンコード区間とされて、再エンコード区間の開始位置のVBV(Video Buffering Verifier)バッファのオキュパンシが、ストリームA1の位置α1におけるオキュパンシの位置から推移が開始され、再エンコード区間の終了位置におけるオキュパンシが、ストリームB1の位置β1におけるオキュパンシの位置で終了するように、再エンコード区間が再エンコードされる。   In the example of FIG. 1, the part from the start position α1 of the GOP including the editing point Pa1 of the stream A1 to the editing point Pa1, and the editing point Pb1 of the stream B1 to the end position β1 of the GOP including the editing point Pb1. The parts are decoded and connected to form a stream C1. The stream C1 obtained by the connection is set as a re-encoding section, and the occupancy of the VBV (Video Buffering Verifier) buffer at the start position of the re-encoding section starts to change from the occupancy position at the position α1 of the stream A1. The re-encoding section is re-encoded so that the occupancy at the end position of the re-encoding section ends at the position of the occupancy at the position β1 of the stream B1.

そして、再エンコードされたストリームC1は、その開始位置および終了位置が、それぞれストリームA1の位置α1以前の部分およびストリームB1の位置β1以降の部分と接続され、ストリームD1とされる。すなわち、ストリームA1の区間a1および区間b1までの符号、ストリームC1の区間d1の符号、並びにストリームB1の区間c1以降の符号からなるストリームD1が、編集の結果として得られたストリームとされる。   Then, the re-encoded stream C1 has a start position and an end position connected to a part before the position α1 of the stream A1 and a part after the position β1 of the stream B1, respectively, to form a stream D1. That is, the stream D1 including the code up to the section a1 and the section b1 of the stream A1, the code of the section d1 of the stream C1, and the code after the section c1 of the stream B1 is a stream obtained as a result of editing.

ところで、上述したカット編集の技術が用いられて、記録メディアに記録されているストリーム(以下、下地データとも称する)における所定の区間を、他のストリーム(以下、上書きデータ)に置き換えることによって、下地データの所定の区間に上書きデータを挿入するインサート編集が知られている。   By the way, the above-described cut editing technique is used to replace a predetermined section in a stream (hereinafter also referred to as background data) recorded on a recording medium with another stream (hereinafter referred to as overwrite data). Insert editing is known in which overwrite data is inserted into a predetermined section of data.

インサート編集においては、図2に示すように、下地データであるストリームA2に対して、上書きデータであるストリームB2の所定の区間が挿入され、ストリームB2が挿入されるIN点の近傍およびOUT点の近傍が、カット編集における場合と同様に再エンコードされる。なお、図中、縦方向の線は、それぞれのストリームにおけるGOPの切れ目を示している。   In the insert editing, as shown in FIG. 2, a predetermined section of the stream B2, which is the overwrite data, is inserted into the stream A2, which is the background data, and the vicinity of the IN point and the OUT point where the stream B2 is inserted. The neighborhood is re-encoded as in cut editing. In the figure, vertical lines indicate the GOP breaks in each stream.

図2の例においては、ストリームA2における位置IN2から位置OUT2までの区間に、ストリームB2の位置IN3から位置OUT3までの区間が挿入される。このとき、位置IN2を含むGOPの開始位置α2から位置IN2までの部分と、ストリームB2の位置IN3から、その位置IN3を含むGOPの終了位置β2までの部分とがデコードされて接続され、ストリームC2とされる。   In the example of FIG. 2, the section from the position IN3 to the position OUT3 of the stream B2 is inserted into the section from the position IN2 to the position OUT2 in the stream A2. At this time, the part from the start position α2 to the position IN2 of the GOP including the position IN2 and the part from the position IN3 of the stream B2 to the end position β2 of the GOP including the position IN3 are decoded and connected, and the stream C2 It is said.

同様に、ストリームB2の位置OUT3を含むGOPの開始位置γ2から位置OUT3までの部分と、ストリームA2の位置OUT2から、その位置OUT2を含むGOPの終了位置δ2までの部分とがデコードされて接続され、ストリームD2とされる。   Similarly, the portion from the start position γ2 to the position OUT3 of the GOP including the position OUT3 of the stream B2 and the portion from the position OUT2 of the stream A2 to the end position δ2 of the GOP including the position OUT2 are decoded and connected. , Stream D2.

さらに、ストリームC2およびストリームD2が再エンコードされ、ストリームA2およびストリームB2と、再エンコードされたストリームC2およびストリームD2とが接続されてストリームE2とされる。   Further, the stream C2 and the stream D2 are re-encoded, and the stream A2 and the stream B2 and the re-encoded stream C2 and the stream D2 are connected to be a stream E2.

すなわち、ストリームA2の位置α2までの区間a2の符号、ストリームC2の区間j2の符号、ストリームB2の位置β2から位置γ2までの区間、すなわち区間g2、区間h2、および区間i2の符号、ストリームD2の区間k2の符号、並びにストリームA2の位置δ2以降の区間f2の符号からなるストリームE2が、インサート編集の結果として得られるストリームとされる。   That is, the code of the section a2 up to the position α2 of the stream A2, the code of the section j2 of the stream C2, the section of the stream B2 from the position β2 to the position γ2, that is, the codes of the section g2, the section h2, and the section i2, and the stream D2 A stream E2 including the code of the section k2 and the code of the section f2 after the position δ2 of the stream A2 is a stream obtained as a result of the insert editing.

なお、以下の説明において、位置IN2または位置IN3をIN点とも称し、位置OUT2または位置OUT3をOUT点とも称する。   In the following description, the position IN2 or the position IN3 is also referred to as an IN point, and the position OUT2 or the position OUT3 is also referred to as an OUT point.

このような記録メディアに記録されているストリームの所定の区間を、他のストリームに置き換えるインサート編集は、VTR(Video Tape Recorder)に記録されている動画像信号に対してインサート編集を行う場合と同様の効果が得られる。すなわち、下地データが記録されている記録メディアに、他のデータを記録する記録容量がない場合においても、下地データの編集の対象となる区間に他のデータを上書きすることで、記録メディアに記録されている下地データを編集することができる。   Insert editing that replaces a predetermined section of a stream recorded on such a recording medium with another stream is the same as when insert editing is performed on a moving image signal recorded on a VTR (Video Tape Recorder). The effect is obtained. In other words, even when the recording medium on which the background data is recorded does not have a recording capacity for recording other data, the other data is overwritten in the section to be edited of the background data, so that the data is recorded on the recording medium. The background data being edited can be edited.

多くの記録メディアにおいては、その記録メディアへのデータの記録時にクラスタ管理が行われている。すなわち、多くの記録メディアでは、その記録メディアごと、または記録メディアにデータを記録する装置の動作を制御するOS(Operating System)ごとに、記録メディアの記録単位である固有の大きさのクラスタが用意され、記録されるデータは、そのクラスタの大きさに分割されて記録メディアに記録される。ここで、クラスタの大きさは、例えば1Byte以上の所定の大きさとされる。   In many recording media, cluster management is performed when data is recorded on the recording medium. That is, in many recording media, a cluster of a specific size, which is a recording unit of the recording medium, is prepared for each recording medium or for each OS (Operating System) that controls the operation of a device that records data on the recording medium. The data to be recorded is divided into the cluster size and recorded on the recording medium. Here, the size of the cluster is, for example, a predetermined size of 1 Byte or more.

例えば、可変長符号化された動画像ファイルが記録メディアに記録される場合、その動画像ファイルは、各フレームがクラスタの大きさに分割され、フレームごとに記録される。したがって、1つのクラスタには、1つのフレームのデータだけが格納されて記録される。   For example, when a variable length encoded moving image file is recorded on a recording medium, each frame of the moving image file is divided into clusters and recorded for each frame. Therefore, only one frame of data is stored and recorded in one cluster.

特開2006−67095号公報JP 2006-67095 A

ところが、動画像の1フレーム分の符号長、すなわち各フレームの大きさは、必ずしもクラスタの大きさの整数倍ではないため、記録メディア上の動画像ファイルが記録されているクラスタのなかには、クラスタギャップを有するクラスタが存在する。   However, since the code length of one frame of a moving image, that is, the size of each frame is not necessarily an integral multiple of the size of the cluster, a cluster gap is included in a cluster in which a moving image file on a recording medium is recorded. There is a cluster with

したがって、互いにストリーム全体のデータ量が等しいストリームであっても、フレームの絵柄が異なる場合、各フレームの大きさは異なるので、それらのストリームを記録するときのクラスタギャップを有するクラスタの数も異なり、それぞれのストリームを記録メディアに記録するために必要とされるクラスタ数、つまり記録容量も異なる。   Therefore, even if the data amount of the entire stream is equal to each other, if the frame design is different, the size of each frame is different, so the number of clusters having a cluster gap when recording these streams is also different, The number of clusters required for recording each stream on the recording medium, that is, the recording capacity is also different.

例えば、図3に示すように、ストリームPおよびストリームQを記録メディアに記録する場合、それらのストリームの符号量は同じであっても、ストリームを記録するために必要となるクラスタ数は異なる。   For example, as shown in FIG. 3, when the stream P and the stream Q are recorded on the recording medium, the number of clusters required for recording the stream is different even if the code amount of the streams is the same.

図3には、ストリームPおよびストリームQを構成する各フレーム、すなわち各ピクチャの符号量および各ピクチャの記録に必要とされるクラスタ数と、ストリームPおよびストリームQの符号量およびそれらのストリームの記録に必要とされるクラスタ数とが示されている。なお、ストリームPおよびストリームQは、ピクチャレートが30Hz、ビットレートが50Mbps、GOP内のピクチャ数が15、IピクチャまたはPピクチャの間隔を示すM値が3である、CBR(Constant Bit Rate)によりエンコードされたストリームであり、図3における1つのクラスタの大きさは2000Byteとされている。   FIG. 3 shows each frame constituting stream P and stream Q, that is, the code amount of each picture and the number of clusters required for recording each picture, the code amount of stream P and stream Q, and the recording of those streams. The number of clusters required for each is shown. Note that the stream P and the stream Q have a picture rate of 30 Hz, a bit rate of 50 Mbps, the number of pictures in the GOP is 15, and an M value indicating an interval between I pictures or P pictures is 3, which is based on CBR (Constant Bit Rate). This is an encoded stream, and the size of one cluster in FIG. 3 is 2000 bytes.

図3の例では、ストリームPの先頭のピクチャI2の符号量は10000000Byteであり、クラスタ数は5000個とされている。これに対して、ストリームQの先頭のピクチャI2の符号量は9999986Byteであり、クラスタ数は5000個であるので、ストリームQのピクチャI2の符号量は、ストリームPのピクチャI2の符号量よりも少ないが、記録に必要なクラスタ数はストリームPのピクチャI2と同じ数となっている。   In the example of FIG. 3, the code amount of the leading picture I2 of the stream P is 10000000 bytes and the number of clusters is 5000. On the other hand, since the code amount of the leading picture I2 of the stream Q is 9999986 Bytes and the number of clusters is 5000, the code amount of the picture I2 of the stream Q is smaller than the code amount of the picture I2 of the stream P. However, the number of clusters required for recording is the same as the picture I2 of the stream P.

また、ピクチャB0以降のピクチャ、すなわちピクチャB0乃至ピクチャB13のそれぞれについては、ストリームQよりもストリームPの方が各ピクチャの符号量は1Byteだけ少なく、クラス多数も1個だけ少なくなっている。   In addition, for each of the pictures after the picture B0, that is, the pictures B0 to B13, the code amount of each picture is smaller by 1 byte than the stream Q, and the number of classes is also decreased by one.

さらに、ストリームPおよびストリームQのそれぞれは、符号量が25000000Byteであり同じであるが、ストリームPを記録するために必要なクラスタ数が12500個であるのに対して、ストリームQを記録するために必要なクラスタ数は12514個であり、ストリームPにおける場合よりも14個だけ多くなっている。   Further, each of the stream P and the stream Q has the same code amount of 25000000 bytes, but the number of clusters necessary for recording the stream P is 12,500, whereas the stream Q is recorded. The required number of clusters is 12,514, which is 14 more than in the stream P.

このように、可変長符号化により得られたストリームは、同じデータ量のストリームであっても、記録メディアにおける記録に必要な記録容量は異なる。そのため、図2を参照して説明したインサート編集を行い、下地データの所定の区間に上書きデータを上書きしようとした場合に、その下地データの区間と、上書きデータとは、データ量が同じであっても、記録メディア上の大きさ、すなわち記録に必要なクラスタ数は一般には異なるので、上書きデータの記録に必要なクラスタ数が、下地データにおける上書きデータが挿入される区間のクラスタ数よりも多いときには、下地データに上書きデータを挿入することができなくなってしまう。   Thus, even if the streams obtained by variable length coding are streams having the same data amount, the recording capacities required for recording on the recording medium are different. Therefore, when the insert editing described with reference to FIG. 2 is performed and overwrite data is overwritten in a predetermined section of the background data, the data amount of the background data section and the overwrite data is the same. However, since the size on the recording medium, that is, the number of clusters necessary for recording is generally different, the number of clusters necessary for recording the overwrite data is larger than the number of clusters in the section where the overwrite data is inserted in the base data. In some cases, it becomes impossible to insert overwrite data into the background data.

つまり、図2において、ストリームA2乃至ストリームD2のそれぞれがCBRによりエンコードされて得られたストリームである場合、VBVバッファのオキュパンシが連続で、またビットレートが0となる期間はないため、ストリームA2における位置α2から位置δ2までの区間、すなわち区間b2から区間e2までの総符号量と、ストリームE2における区間j2から区間k2までの総符号量とは同じとなる。しかしながら、記録に必要なクラスタ数は必ずしも同じではないため、記録メディアにおけるストリームA2の位置α2から位置δ2までの部分に、ストリームE2の区間j2乃至区間k2までの部分を上書きすることができないおそれがある。   That is, in FIG. 2, when each of stream A2 to stream D2 is a stream obtained by encoding by CBR, the occupancy of the VBV buffer is continuous and there is no period in which the bit rate is 0. The total code amount from the position α2 to the position δ2, that is, the total code amount from the section b2 to the section e2, and the total code amount from the section j2 to the section k2 in the stream E2 are the same. However, since the number of clusters required for recording is not necessarily the same, there is a possibility that the portion from the section j2 to the section k2 of the stream E2 cannot be overwritten on the portion from the position α2 to the position δ2 of the stream A2 on the recording medium. is there.

従来、下地データにおける上書きデータが挿入される部分のクラスタ数よりも、上書きデータの記録に必要なクラスタ数が多く、下地データを上書きデータに書き換えることができない場合、上書きデータは、記録メディア上における下地データが記録されている領域とは異なる領域に記録されていた。   Conventionally, when the number of clusters required for recording overwrite data is larger than the number of clusters in the portion where overwrite data is inserted in the background data and the background data cannot be rewritten to the overwrite data, the overwrite data is recorded on the recording medium. It was recorded in an area different from the area where the background data was recorded.

したがって、下地データのクラスタ数よりも、上書きデータの記録に必要なクラスタ数が多いために下地データを上書きデータに書き換えることができず、さらに下地データが記録されている記録メディアに、上書きデータを記録するために必要な記録容量が残っていない場合には、下地データを編集することができなくなってしまう。   Therefore, since the number of clusters required for recording the overwrite data is larger than the number of clusters of the background data, the background data cannot be rewritten to the overwrite data, and the overwrite data is not recorded on the recording medium on which the background data is recorded. If the recording capacity necessary for recording does not remain, the base data cannot be edited.

また、記録メディアに予め上書きデータを記録するための記録領域をある程度確保しておくこともできるが、その記録領域の大きさは、編集の回数や上書きデータの大きさによって異なるので、予め適切な大きさの記録領域を確保しておくことは困難であった。   In addition, a recording area for recording overwrite data in advance on the recording medium can be secured to some extent. However, the size of the recording area varies depending on the number of edits and the size of the overwrite data. It was difficult to ensure a large recording area.

さらに、インサート編集の結果、記録メディア上における下地データの所定の区間を上書きデータに書き換えることができず、上書きデータが下地データの記録されている領域とは異なる領域に記録された場合、インサート編集において下地データの所定の区間に接続された上書きデータは、上書きデータの直前に再生される下地データが記録されている位置とは物理的に不連続な位置に記録されているので、上書きデータの部分の再生を行うときには、その上書きデータの直前に再生される下地データが記録されている位置から、上書きデータが記録されている位置までジャンプして再生しなければならなかった。   Furthermore, as a result of the insert editing, if the predetermined section of the background data on the recording medium cannot be rewritten to the overwrite data, and the overwrite data is recorded in an area different from the area where the background data is recorded, Since the overwrite data connected to a predetermined section of the background data is recorded at a position physically discontinuous from the position where the background data to be reproduced immediately before the overwrite data is recorded, When the part is reproduced, it is necessary to jump from the position where the background data to be reproduced immediately before the overwrite data is recorded to the position where the overwrite data is recorded and reproduce it.

そのような場合、記録メディアや、データを再生する装置特有の条件によっては、記録位置の物理的なジャンプに長い時間が必要とされたり、データを一時的に記憶するバッファが必要とされたりするので、ジャンプやバッファリングにより生じるある程度の遅延が容認されなければ、下地データに挿入される上書きデータの再生区間には時間的な制限が必要であった。つまり、下地データを上書きデータに書き換えることができるように、上書きデータの再生時間、すなわちデータ量を少なくする必要があった。   In such a case, depending on the conditions specific to the recording medium and the device that reproduces the data, a long time is required for the physical jump of the recording position, or a buffer for temporarily storing the data is required. Therefore, if a certain amount of delay caused by jumping or buffering is not allowed, a time limit is necessary for the reproduction section of the overwrite data inserted into the base data. In other words, it is necessary to reduce the reproduction time of the overwrite data, that is, the data amount so that the base data can be rewritten to the overwrite data.

本発明は、このような状況に鑑みてなされたものであり、記録メディアに記録できる記録容量が残り少ない場合であっても、インサート編集されたストリームを確実に記録メディアに記録することができるようにするものである。   The present invention has been made in view of such a situation, and it is possible to reliably record an insert edited stream on a recording medium even when the recording capacity that can be recorded on the recording medium is small. To do.

本発明の一側面の情報処理装置は、記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理装置であって、前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出するクラスタ数算出手段と、前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する再エンコード手段と、前記クラスタ数算出手段により算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出する符号量算出手段と、前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記再エンコード手段による再エンコードを制御する再エンコード制御手段とを備える。   An information processing apparatus according to an aspect of the present invention sets a target code amount and re-encodes a second encoded stream in a predetermined section of the first encoded stream recorded on a recording medium. An information processing apparatus that performs a process from a first position before an IN point that is a start position of the predetermined section to a second position after an OUT point that is an end position of the predetermined section From the first cluster number required for recording the first encoded stream and the third position in the vicinity of the start position of the second encoded stream, the end position of the second encoded stream is determined. Video obtained by decoding the first encoded stream from the first position to the IN point using the second number of clusters required for recording up to the fourth position in the vicinity Of the signal and the second encoded stream A first video signal connected to a video signal obtained by decoding the second encoded stream from a start position to the third position, and the second code from the fourth position. Video signal obtained by decoding the second encoded stream up to the end position of the encoded stream and video obtained by decoding the first encoded stream from the OUT point to the second position A cluster number calculating means for calculating a third cluster number that can be used for recording the second video signal connected to the signal, and re-encoding the first video signal and the second video signal. , Using the re-encoding means for generating the first re-encoded stream and the second re-encoded stream, and the third cluster number calculated by the cluster number calculating means. A code amount calculating means for calculating a target code amount for re-encoding the signal and the second video signal, and a generated code amount obtained by re-encoding the first video signal and the second video signal. Re-encoding control means for controlling re-encoding by the re-encoding means so as to achieve the target code amount.

情報処理装置には、前記再エンコード手段により生成された前記第1の再符号化ストリーム、前記第3の位置から前記第4の位置までの前記第2の符号化ストリーム、および前記第2の再符号化ストリームをそれぞれ接続して、前記記録メディアにおける前記第1の位置から前記第2の位置までの前記第1の符号化ストリームが記録されている位置に記録する記録手段をさらに設けることができる。   The information processing apparatus includes the first re-encoded stream generated by the re-encoding unit, the second encoded stream from the third position to the fourth position, and the second re-encoded stream. Recording means for connecting the encoded streams and recording the first encoded stream from the first position to the second position on the recording medium at a position where the first encoded stream is recorded can be further provided. .

前記クラスタ数算出手段には、前記第3のクラスタ数を用いて、前記第1の映像信号の記録に用いることのできる第4のクラスタ数と、前記第2の映像信号の記録に用いることのできる第5のクラスタ数とをさらに求めさせ、前記符号量算出手段には、前記第4のクラスタ数から、前記第1の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第6のクラスタ数に基づいて、前記第1の映像信号の前記目標符号量を算出させ、前記第5のクラスタ数から、前記第2の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第7のクラスタ数に基づいて、前記第2の映像信号の前記目標符号量を算出させることができる。   The cluster number calculation means uses the third cluster number to use the fourth cluster number that can be used for recording the first video signal and the second video signal that is used for recording. A fifth number of clusters that can be obtained, and the code amount calculating means obtains a number obtained by subtracting a number that is one less than the number of pictures of the first video signal from the number of fourth clusters. The target code amount of the first video signal is calculated on the basis of the number of clusters of 6, and a number that is less by 1 than the number of pictures of the second video signal is subtracted from the fifth cluster number. The target code amount of the second video signal can be calculated based on the obtained seventh cluster number.

前記第1の符号化ストリーム、前記第2の符号化ストリーム、前記第1の再符号化ストリーム、および前記第2の再符号化ストリームは、MPEG規格に準じるようにすることができる。   The first encoded stream, the second encoded stream, the first re-encoded stream, and the second re-encoded stream may conform to the MPEG standard.

前記符号量算出手段には、前記第6のクラスタ数に、クラスタサイズを乗算して得られる値から、前記第1の位置におけるVBVバッファのオキュパンシと前記第3の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第1の映像信号の前記目標符号量として算出させ、前記第7のクラスタ数に、前記クラスタサイズを乗算して得られる値から、前記第4の位置におけるVBVバッファのオキュパンシと前記第2の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第2の映像信号の前記目標符号量として算出させることができる。   The code amount calculation means calculates the occupancy of the VBV buffer at the first position and the occupancy of the VBV buffer at the third position from a value obtained by multiplying the sixth cluster number by the cluster size. A value obtained by subtracting the difference is calculated as the target code amount of the first video signal, and the fourth position is calculated from a value obtained by multiplying the seventh cluster number by the cluster size. The value obtained by subtracting the difference between the occupancy of the VBV buffer at the second position and the occupancy of the VBV buffer at the second position can be calculated as the target code amount of the second video signal.

前記符号量算出手段には、さらに、前記第1の映像信号の前記目標符号量を用いて、前記第1の映像信号が再エンコードされるときのビットレートを算出させ、前記第2の映像信号の前記目標符号量を用いて、前記第2の映像信号が再エンコードされるときのビットレートを算出させることができる。   The code amount calculation means further calculates a bit rate when the first video signal is re-encoded using the target code amount of the first video signal, and the second video signal The bit rate when the second video signal is re-encoded can be calculated using the target code amount.

情報処理装置には、前記第4のクラスタ数と、前記第1の再符号化ストリームの記録に必要とされるクラスタ数との差である第1の残りクラスタ数を求め、前記第1の残りクラスタ数を、前記第1の再符号化ストリームを構成する各GOPに配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入し、前記第5のクラスタ数と、前記第2の再符号化ストリームの記録に必要とされるクラスタ数との差である第2の残りクラスタ数を求め、前記第2の残りクラスタ数を、前記第2の再符号化ストリームを構成する各GOPに配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入する挿入手段をさらに設けることができる。   The information processing apparatus obtains a first remaining cluster number that is a difference between the fourth cluster number and the number of clusters required for recording the first re-encoded stream, and the first remaining cluster number The number of clusters is allocated to each GOP constituting the first re-encoded stream, dummy data corresponding to the number of clusters allocated to each GOP is inserted at the end of those GOPs, and the fifth cluster number And a second remaining cluster number that is a difference between the number of clusters required for recording the second re-encoded stream, and the second remaining cluster number is determined as the second re-encoded stream. Further, it is possible to further provide insertion means for allocating dummy data corresponding to the number of clusters allocated to each GOP at the end of those GOPs.

本発明の一側面の情報処理方法またはプログラムは、記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理を実行するためのものであって、前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出し、算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出し、前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードを制御し、前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成するステップを含む。   An information processing method or program according to one aspect of the present invention sets a target code amount when recording a second encoded stream in a predetermined section of a first encoded stream recorded on a recording medium. For executing information processing for performing re-encoding, from a first position before an IN point that is a start position of the predetermined section, from an OUT point that is an end position of the predetermined section From the first number of clusters required for recording the first encoded stream up to the second position after the second and the third position in the vicinity of the start position of the second encoded stream, the second The first encoded stream from the first position to the IN point using the second number of clusters required for recording up to the fourth position in the vicinity of the end position of the encoded stream of Video signal obtained by decoding And the first video signal obtained by decoding the second encoded stream from the start position of the second encoded stream to the third position, and the first video signal, 4 and the video signal obtained by decoding the second encoded stream from the position 4 to the end position of the second encoded stream, and the first encoding from the OUT point to the second position. A third cluster number that can be used for recording the second video signal connected to the video signal obtained by decoding the stream is calculated, and using the calculated third cluster number, A target code amount when re-encoding the first video signal and the second video signal is calculated, and a generated code amount obtained by re-encoding the first video signal and the second video signal is Goal mark Control the re-encoding of the first video signal and the second video signal to re-encode the first video signal and the second video signal so that the first re-encoding Generating an encoded stream and a second re-encoded stream.

本発明の一側面においては、記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理において、前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とが用いられて、前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数が算出され、算出された前記第3のクラスタ数が用いられて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量が算出され、前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードが制御され、前記第1の映像信号および前記第2の映像信号が再エンコードされて、第1の再符号化ストリームおよび第2の再符号化ストリームが生成される。   In one aspect of the present invention, information for performing re-encoding by setting a target code amount when recording the second encoded stream in a predetermined section of the first encoded stream recorded on the recording medium. In the processing, the first code from the first position before the IN point that is the start position of the predetermined section to the second position after the OUT point that is the end position of the predetermined section From the first number of clusters required for recording the encoded stream and the third position near the start position of the second encoded stream, the fourth position near the end position of the second encoded stream And the second number of clusters required for recording until the first encoded stream from the first position to the IN point is decoded and the second cluster number is used. Starting position of the encoded stream A first video signal connected to a video signal obtained by decoding the second encoded stream from the third position to the third position, and the second encoded stream from the fourth position. And a video signal obtained by decoding the second encoded stream up to the end position, and a video signal obtained by decoding the first encoded stream from the OUT point to the second position; Is calculated, and the third number of clusters that can be used for recording the second video signal connected to the second video signal is calculated, and the calculated third cluster number is used to calculate the first video signal and the second video signal. A target code amount for re-encoding the video signal is calculated, and the generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. 1 movie Re-encoding of the signal and the second video signal is controlled, the first video signal and the second video signal are re-encoded, and the first re-encoded stream and the second re-encoded stream are Generated.

本発明の一側面によれば、インサート編集されたストリームを記録メディアに記録することができる。特に、本発明の一側面によれば、インサート編集されたストリームを確実に記録メディアに記録することができる。   According to one aspect of the present invention, an insert edited stream can be recorded on a recording medium. In particular, according to one aspect of the present invention, it is possible to reliably record an insert edited stream on a recording medium.

以下に本発明の実施の形態を説明するが、本発明の構成要件と、明細書又は図面に記載の実施の形態との対応関係を例示すると、次のようになる。この記載は、本発明をサポートする実施の形態が、明細書又は図面に記載されていることを確認するためのものである。従って、明細書又は図面中には記載されているが、本発明の構成要件に対応する実施の形態として、ここには記載されていない実施の形態があったとしても、そのことは、その実施の形態が、その構成要件に対応するものではないことを意味するものではない。逆に、実施の形態が構成要件に対応するものとしてここに記載されていたとしても、そのことは、その実施の形態が、その構成要件以外の構成要件には対応しないものであることを意味するものでもない。   Embodiments of the present invention will be described below. Correspondences between the constituent elements of the present invention and the embodiments described in the specification or the drawings are exemplified as follows. This description is intended to confirm that the embodiments supporting the present invention are described in the specification or the drawings. Therefore, even if there is an embodiment which is described in the specification or the drawings but is not described here as an embodiment corresponding to the constituent elements of the present invention, that is not the case. It does not mean that the form does not correspond to the constituent requirements. Conversely, even if an embodiment is described here as corresponding to a configuration requirement, that means that the embodiment does not correspond to a configuration requirement other than the configuration requirement. It's not something to do.

本発明の一側面の情報処理装置は、記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理装置であって、前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出するクラスタ数算出手段(例えば、図6のクラスタ算出部141)と、前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する再エンコード手段(例えば、図4のエンコーダ59)と、前記クラスタ数算出手段により算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出する符号量算出手段(例えば、図6の符号量算出部142)と、前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記再エンコード手段による再エンコードを制御する再エンコード制御手段(例えば、図6の符号化制御部128)とを備える。   An information processing apparatus according to an aspect of the present invention sets a target code amount and re-encodes a second encoded stream in a predetermined section of the first encoded stream recorded on a recording medium. An information processing apparatus that performs a process from a first position before an IN point that is a start position of the predetermined section to a second position after an OUT point that is an end position of the predetermined section From the first cluster number required for recording the first encoded stream and the third position in the vicinity of the start position of the second encoded stream, the end position of the second encoded stream is determined. Video obtained by decoding the first encoded stream from the first position to the IN point using the second number of clusters required for recording up to the fourth position in the vicinity Of the signal and the second encoded stream A first video signal connected to a video signal obtained by decoding the second encoded stream from a start position to the third position, and the second code from the fourth position. Video signal obtained by decoding the second encoded stream up to the end position of the encoded stream and video obtained by decoding the first encoded stream from the OUT point to the second position A cluster number calculating means for calculating a third cluster number that can be used for recording the second video signal connected to the signal (for example, the cluster calculating unit 141 in FIG. 6), the first video signal, Re-encoding means for re-encoding the second video signal to generate a first re-encoded stream and a second re-encoded stream (for example, the encoder 59 in FIG. 4), and the class Code amount calculation means for calculating a target code amount for re-encoding the first video signal and the second video signal using the third cluster number calculated by the number calculation means (for example, FIG. 6 code amount calculation unit 142) and re-encoding by the re-encoding means so that a generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. Re-encoding control means (for example, the encoding control unit 128 in FIG. 6).

情報処理装置には、前記再エンコード手段により生成された前記第1の再符号化ストリーム、前記第3の位置から前記第4の位置までの前記第2の符号化ストリーム、および前記第2の再符号化ストリームをそれぞれ接続して、前記記録メディアにおける前記第1の位置から前記第2の位置までの前記第1の符号化ストリームが記録されている位置に記録する記録手段(例えば、図4のドライブ47)をさらに設けることができる。   The information processing apparatus includes the first re-encoded stream generated by the re-encoding unit, the second encoded stream from the third position to the fourth position, and the second re-encoded stream. Recording means (for example, in FIG. 4) that connects the encoded streams and records the first encoded stream from the first position to the second position on the recording medium at the position where the first encoded stream is recorded. A drive 47) can further be provided.

前記クラスタ数算出手段には、前記第3のクラスタ数を用いて、前記第1の映像信号の記録に用いることのできる第4のクラスタ数と、前記第2の映像信号の記録に用いることのできる第5のクラスタ数とをさらに求めさせ(例えば、図12のステップS16の処理)、前記符号量算出手段には、前記第4のクラスタ数から、前記第1の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第6のクラスタ数に基づいて、前記第1の映像信号の前記目標符号量を算出させ、前記第5のクラスタ数から、前記第2の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第7のクラスタ数に基づいて、前記第2の映像信号の前記目標符号量を算出させる(例えば、図15のステップS52の処理)ことができる。   The cluster number calculation means uses the third cluster number to use the fourth cluster number that can be used for recording the first video signal and the second video signal that is used for recording. The number of possible fifth clusters is further obtained (for example, the process of step S16 in FIG. 12), and the code amount calculation means determines that the number of fourth clusters is larger than the number of pictures in the first video signal. The target code amount of the first video signal is calculated based on a sixth cluster number obtained by subtracting a number smaller by 1 and the picture of the second video signal is calculated from the fifth cluster number. The target code amount of the second video signal can be calculated based on the seventh cluster number obtained by subtracting the number smaller by 1 than the number (for example, the process of step S52 in FIG. 15). .

前記符号量算出手段には、前記第6のクラスタ数に、クラスタサイズを乗算して得られる値から、前記第1の位置におけるVBVバッファのオキュパンシと前記第3の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第1の映像信号の前記目標符号量として算出させ、前記第7のクラスタ数に、前記クラスタサイズを乗算して得られる値から、前記第4の位置におけるVBVバッファのオキュパンシと前記第2の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第2の映像信号の前記目標符号量として算出させる(例えば、図15のステップS52の処理)ことができる。   The code amount calculation means calculates the occupancy of the VBV buffer at the first position and the occupancy of the VBV buffer at the third position from a value obtained by multiplying the sixth cluster number by the cluster size. A value obtained by subtracting the difference is calculated as the target code amount of the first video signal, and the fourth position is calculated from a value obtained by multiplying the seventh cluster number by the cluster size. The value obtained by subtracting the difference between the occupancy of the VBV buffer at the second position and the occupancy of the VBV buffer at the second position is calculated as the target code amount of the second video signal (for example, step S52 in FIG. 15). Processing).

前記符号量算出手段には、さらに、前記第1の映像信号の前記目標符号量を用いて、前記第1の映像信号が再エンコードされるときのビットレートを算出させ、前記第2の映像信号の前記目標符号量を用いて、前記第2の映像信号が再エンコードされるときのビットレートを算出させる(例えば、図15のステップS53の処理)ことができる。   The code amount calculation means further calculates a bit rate when the first video signal is re-encoded using the target code amount of the first video signal, and the second video signal The bit rate when the second video signal is re-encoded can be calculated using the target code amount (for example, the process of step S53 in FIG. 15).

情報処理装置には、前記第4のクラスタ数と、前記第1の再符号化ストリームの記録に必要とされるクラスタ数との差である第1の残りクラスタ数を求め、前記第1の残りクラスタ数を、前記第1の再符号化ストリームを構成する各GOPに配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入し、前記第5のクラスタ数と、前記第2の再符号化ストリームの記録に必要とされるクラスタ数との差である第2の残りクラスタ数を求め、前記第2の残りクラスタ数を、前記第2の再符号化ストリームを構成する各GOPに配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入する挿入手段(例えば、図6のダミーデータ挿入部129)をさらに設けることができる。   The information processing apparatus obtains a first remaining cluster number that is a difference between the fourth cluster number and the number of clusters required for recording the first re-encoded stream, and the first remaining cluster number The number of clusters is allocated to each GOP constituting the first re-encoded stream, dummy data corresponding to the number of clusters allocated to each GOP is inserted at the end of those GOPs, and the fifth cluster number And a second remaining cluster number that is a difference between the number of clusters required for recording the second re-encoded stream, and the second remaining cluster number is determined as the second re-encoded stream. And inserting means (for example, dummy data insertion unit 129 in FIG. 6) for inserting dummy data for the number of clusters allocated to each GOP at the end of those GOPs. it can.

本発明の一側面の情報処理方法またはプログラムは、記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理を実行させるためのものであって、前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出し(例えば、図12のステップS15)、算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出し(例えば、図15のステップS52)、前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードを制御し、前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する(例えば、図15のステップS54およびステップS57)ステップを含む。   An information processing method or program according to one aspect of the present invention sets a target code amount when recording a second encoded stream in a predetermined section of a first encoded stream recorded on a recording medium. For executing information processing for performing re-encoding, from a first position before an IN point that is a start position of the predetermined section, to an OUT point that is an end position of the predetermined section From the first number of clusters required for recording the first encoded stream up to the second position after the second and the third position in the vicinity of the start position of the second encoded stream, the second The first encoded stream from the first position to the IN point using the second number of clusters required for recording up to the fourth position in the vicinity of the end position of the encoded stream of Decoded video A video signal obtained by decoding the second encoded stream from the start position of the second encoded stream to the third position, and the video signal obtained by decoding the second encoded stream, and The video signal obtained by decoding the second encoded stream from the fourth position to the end position of the second encoded stream, and the first code from the OUT point to the second position The third number of clusters that can be used for recording the second video signal connected to the video signal obtained by decoding the video stream is calculated (for example, step S15 in FIG. 12), and the calculated Using the third number of clusters, a target code amount for re-encoding the first video signal and the second video signal is calculated (for example, step S52 in FIG. 15), and the first video signal is calculated. And Re-encoding of the first video signal and the second video signal is controlled such that a generated code amount obtained by re-encoding the second video signal becomes the target code amount, Re-encoding the video signal and the second video signal to generate a first re-encoded stream and a second re-encoded stream (eg, step S54 and step S57 in FIG. 15).

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

図4は本発明を適用した編集装置31のハードウェア構成を示すブロック図である。   FIG. 4 is a block diagram showing a hardware configuration of the editing apparatus 31 to which the present invention is applied.

CPU(Central Processing Unit)41は、ノースブリッジ42に接続され、例えば、HDD(Hard disk Drive)46または記録メディア48に記録されているデータの読み出しなどの処理を制御したり、CPU52が実行する編集処理を制御するための制御信号やコマンドを生成して出力したりする。ノースブリッジ42は、PCIバス(Peripheral Component Interconnect/Interface)44に接続され、例えば、CPU41の制御に基づいて、サウスブリッジ45を介して、HDD46または記録メディア48に記録されているデータの供給を受けて、PCIバス44、PCIブリッジ49を介して、メモリ50、デコーダ54、またはデコーダ55に供給する。また、ノースブリッジ42は、メモリ43とも接続されており、CPU41の処理に必要なデータを授受する。   A CPU (Central Processing Unit) 41 is connected to the North Bridge 42, and controls processing such as reading of data recorded on an HDD (Hard disk Drive) 46 or a recording medium 48, and editing executed by the CPU 52, for example. Generate and output control signals and commands for controlling processing. The north bridge 42 is connected to a PCI bus (Peripheral Component Interconnect / Interface) 44 and receives supply of data recorded in the HDD 46 or the recording medium 48 via the south bridge 45 based on the control of the CPU 41, for example. Then, the data is supplied to the memory 50, the decoder 54, or the decoder 55 via the PCI bus 44 and the PCI bridge 49. The north bridge 42 is also connected to the memory 43, and exchanges data necessary for the processing of the CPU 41.

メモリ43は、CPU41が実行する処理に必要なデータを保存する。サウスブリッジ45は、HDD46のデータの書き込みおよび読み出しを制御する。HDD46には、記録メディア48に記録されている圧縮符号化されたインサート編集の対象となる圧縮映像データ(以下、適宜、下地データも称する)の所定の位置に挿入される圧縮映像データ(以下、適宜、上書きデータとも称する)が記録される。   The memory 43 stores data necessary for processing executed by the CPU 41. The south bridge 45 controls writing and reading of data in the HDD 46. In the HDD 46, compressed video data (hereinafter, referred to as base data), which is a target of compression-encoded insert editing recorded on the recording medium 48, is inserted at a predetermined position. (Also referred to as overwrite data as appropriate) is recorded.

また、サウスブリッジ45には、ドライブ47が接続されており、ドライブ47は、記録メディア48から下地データを読み出したり、サウスブリッジ45から供給された下地データや上書きデータを記録メディア48に記録したりする。記録メディア48は、例えば、磁気ディスク、光ディスク、光磁気ディスク、或いは半導体メモリなどからなり、インサート編集の対象となる下地データを記録している。   In addition, a drive 47 is connected to the south bridge 45, and the drive 47 reads background data from the recording medium 48, and records background data and overwrite data supplied from the south bridge 45 on the recording medium 48. To do. The recording medium 48 is made of, for example, a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, and records background data to be subjected to insert editing.

PCIブリッジ49は、メモリ50のデータの書き込みおよび読み出しを制御したり、デコーダ54、デコーダ55、またはストリームスプライサ57への圧縮映像データの供給を制御するとともに、PCIバス44およびコントロールバス51のデータの授受を制御する。メモリ50は、PCIブリッジ49の制御に基づいて、HDD46または記録メディア48より読み出された、インサート編集される圧縮映像データや、ストリームスプライサ57から供給される編集後の圧縮映像データを記憶する。   The PCI bridge 49 controls the writing and reading of data in the memory 50, the supply of compressed video data to the decoder 54, the decoder 55, or the stream splicer 57, and the data on the PCI bus 44 and the control bus 51. Control the transfer of. The memory 50 stores, under the control of the PCI bridge 49, compressed video data that is read from the HDD 46 or the recording medium 48 and that is subjected to insert editing, and compressed video data that has been edited and supplied from the stream splicer 57. .

CPU52は、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介して、CPU41から供給された制御信号やコマンドにしたがって、PCIブリッジ49、デコーダ54乃至デコーダ56、ストリームスプライサ57、エフェクト/スイッチ58、エンコーダ59、およびスイッチ60が実行する処理を制御する。メモリ53は、CPU52の処理に必要なデータを記憶する。   The CPU 52 is connected to the PCI bridge 49, the decoder 54 to the decoder 56, the stream splicer 57, in accordance with control signals and commands supplied from the CPU 41 via the north bridge 42, the PCI bus 44, the PCI bridge 49, and the control bus 51. Processes executed by the effect / switch 58, the encoder 59, and the switch 60 are controlled. The memory 53 stores data necessary for the processing of the CPU 52.

デコーダ54乃至デコーダ56は、CPU52の制御に基づいて、供給された圧縮映像データをデコードし、非圧縮の映像信号(ベースバンドの画像データ)を出力する。また、デコーダ54乃至デコーダ56は、編集装置31に含まれない独立した装置として設けられていても良い。例えば、デコーダ56が、独立した装置として設けられている場合、デコーダ56は、後述する処理により編集されて生成された圧縮映像データの供給を受け、復号し、出力することができるようになされる。   Based on the control of the CPU 52, the decoders 54 to 56 decode the supplied compressed video data and output an uncompressed video signal (baseband image data). The decoders 54 to 56 may be provided as independent devices that are not included in the editing device 31. For example, when the decoder 56 is provided as an independent device, the decoder 56 can receive, decode, and output compressed video data that has been edited and generated by processing to be described later. .

ストリームスプライサ57は、CPU52の制御に基づいて、供給された圧縮映像データをデコーダ56に供給したり、PCIブリッジ49を介してメモリ50に供給して保存させたりする。また、ストリームスプライサ57は、エンコーダ59から、エンコード処理において取得されたデータの供給を受け、PCIブリッジ49を介して、メモリ50に供給して保存させることも可能である。   Based on the control of the CPU 52, the stream splicer 57 supplies the supplied compressed video data to the decoder 56, or supplies the compressed video data to the memory 50 via the PCI bridge 49 for storage. The stream splicer 57 can also receive the data obtained in the encoding process from the encoder 59, supply the data to the memory 50 via the PCI bridge 49, and store the data.

エフェクト/スイッチ58は、CPU52の制御に基づいて、デコーダ54またはデコーダ55から供給される非圧縮の映像信号の出力を切り替える。すなわち、エフェクト/スイッチ58は、供給された非圧縮の映像信号を所定のフレームで結合するとともに、必要に応じて所定の範囲にエフェクトを施して、エンコーダ59に供給する。エンコーダ59は、CPU52の制御に基づいて、供給された非圧縮の映像信号をエンコードする。すなわちエンコーダ59は、非圧縮の映像信号をエンコードすることにより、再エンコードされたストリームである再符号化ストリームを生成する。   The effect / switch 58 switches the output of the uncompressed video signal supplied from the decoder 54 or the decoder 55 based on the control of the CPU 52. That is, the effect / switch 58 combines the supplied non-compressed video signal with a predetermined frame, applies an effect to a predetermined range as necessary, and supplies it to the encoder 59. The encoder 59 encodes the supplied uncompressed video signal based on the control of the CPU 52. That is, the encoder 59 encodes an uncompressed video signal to generate a re-encoded stream that is a re-encoded stream.

スイッチ60は、CPU52の制御に基づいて、エフェクト/スイッチ58から出力されるベースバンド画像信号、または、ストリームスプライサ57から供給され、デコーダ56によってデコードされたベースバンド画像信号のいずれかを、外部の、例えば、表示装置などに出力する。   Based on the control of the CPU 52, the switch 60 receives either the baseband image signal output from the effect / switch 58 or the baseband image signal supplied from the stream splicer 57 and decoded by the decoder 56. For example, to a display device.

次に、編集装置31の動作について説明する。   Next, the operation of the editing device 31 will be described.

記録メディア48には、Long GOPのOpen GOP方式で圧縮された下地データ(符号化ストリーム)が記録され、HDD46には、その下地データに挿入される上書きデータ(符号化ストリーム)が記録されている。すなわち、記録メディア48には、図2に示したストリームA2が下地データとして記録されており、HDD46には、図2に示したストリームB2が上書きデータとして記録されている。CPU41は、図示しない操作入力部からユーザの操作入力を受け、編集される2つのストリームと、その編集点の情報を受ける。   Background data (encoded stream) compressed by the Long GOP Open GOP method is recorded on the recording medium 48, and overwrite data (encoded stream) to be inserted into the background data is recorded on the HDD 46. . That is, the stream A2 shown in FIG. 2 is recorded as background data on the recording medium 48, and the stream B2 shown in FIG. The CPU 41 receives a user's operation input from an operation input unit (not shown), and receives two streams to be edited and information on the editing points.

なお、以下の説明においては、ストリームA2とストリームB2とが接続される位置IN2または位置IN3をIN点とも称する。また、ストリームA2とストリームB2とが接続される位置OUT2または位置OUT3をOUT点とも称する。   In the following description, the position IN2 or the position IN3 where the stream A2 and the stream B2 are connected is also referred to as an IN point. The position OUT2 or the position OUT3 where the stream A2 and the stream B2 are connected is also referred to as an OUT point.

CPU41は、圧縮符号化(エンコード)された圧縮映像データであるストリームA2およびストリームB2のGOP構造、並びに編集点、すなわちIN点およびOUT点を示す情報を基に、ストリームA2およびストリームB2のうち、再エンコードを行う範囲(以下、再エンコード区間と称する)を決定する。そして、CPU41は、ストリームA2およびストリームB2の再エンコード区間を、VBV Buffer ModelのVBV占有量の連続性を守ったまま、編集点で接続して1つのストリームとするための処理を実行する。   Based on the GOP structure of the stream A2 and the stream B2, which are compressed video data that has been compression-encoded (encoded), and the information indicating the editing point, that is, the IN point and the OUT point, the CPU 41, among the stream A2 and the stream B2, A range for re-encoding (hereinafter referred to as a re-encoding section) is determined. Then, the CPU 41 executes processing for connecting the re-encoding sections of the stream A2 and the stream B2 at the editing point to form one stream while maintaining the continuity of the VBV occupation amount of the VBV Buffer Model.

すなわち、CPU41は、再エンコード区間の再エンコード処理を実行させるために必要なストリーム、すなわちストリームA2の位置α2から位置IN2までの部分がデコーダ54に供給され、ストリームB2の位置IN3から位置β2までの部分がデコーダ55に供給され、エフェクト/スイッチ58によって、編集点すなわちIN点で接続され、必要に応じてエフェクトが施されるように、制御信号を生成し、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介してCPU52に送出する。   That is, the CPU 41 is supplied with the stream necessary for executing the re-encoding process of the re-encoding section, that is, the portion from the position α2 to the position IN2 of the stream A2, to the decoder 54, and from the position IN3 to the position β2 of the stream B2. The part is supplied to the decoder 55, and is connected by the effect / switch 58 at the edit point, that is, the IN point, and the control signal is generated so that the effect is applied if necessary, and the north bridge 42, PCI bus 44, PCI The data is sent to the CPU 52 via the bridge 49 and the control bus 51.

同様に、CPU41は、ストリームB2の位置γ2から位置OUT3までの部分がデコーダ55に供給され、ストリームA2の位置OUT2から位置δ2までの部分がデコーダ54に供給され、エフェクト/スイッチ58によって、編集点すなわちOUT点で接続され、必要に応じてエフェクトが施されるように、制御信号を生成し、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介してCPU52に送出する。   Similarly, the CPU 41 supplies the part from the position γ2 to the position OUT3 of the stream B2 to the decoder 55, and supplies the part from the position OUT2 to the position δ2 of the stream A2 to the decoder 54. That is, a control signal is generated so as to be connected at the OUT point and an effect is applied as necessary, and is transmitted to the CPU 52 via the north bridge 42, the PCI bus 44, the PCI bridge 49, and the control bus 51.

このようにして、ストリームA2およびストリームB2が、IN点およびOUT点においてそれぞれ接続されて得られた、非圧縮の映像信号としてのストリームC2およびストリームD2は、CPU52の制御に基づいて、エンコーダ59により再エンコードされて、圧縮映像データ(再符号化ストリーム)とされる。   In this way, the stream C2 and the stream D2 as the uncompressed video signals obtained by connecting the stream A2 and the stream B2 at the IN point and the OUT point, respectively, are obtained by the encoder 59 based on the control of the CPU 52. Re-encoding is performed to obtain compressed video data (re-encoded stream).

再エンコード動作が終了された場合、CPU52は、再エンコードされた圧縮映像データ(再符号化ストリーム)としてのストリームC2およびストリームD2がエンコーダ59から、ストリームスプライサ57、およびPCIブリッジ49を介してメモリ50に供給されるように各部を制御する。また、CPU41は、メモリ50に記憶されているストリームC2、HDD46に記録されているストリームB2の位置β2から位置γ2までの部分、およびメモリ50に記憶されているストリームD2が、記録メディア48におけるストリームA2の位置α2から位置δ2までの部分が記録されている位置に上書きされるように、各部を制御する。   When the re-encoding operation is completed, the CPU 52 stores the stream C2 and the stream D2 as the re-encoded compressed video data (re-encoded stream) from the encoder 59 through the stream splicer 57 and the PCI bridge 49. Each unit is controlled to be supplied to 50. Further, the CPU 41 determines that the stream C2 stored in the memory 50, the portion from the position β2 to the position γ2 of the stream B2 recorded in the HDD 46, and the stream D2 stored in the memory 50 are streamed in the recording medium 48. Each part is controlled so that the part from position α2 to position δ2 of A2 is overwritten on the recorded position.

次に、図5は、図4の編集装置31の機能の構成例を示すブロック図である。なお、図5において、図4における場合と対応する部分には同一の符号を付してあり、その説明は適宜省略する。   Next, FIG. 5 is a block diagram illustrating a functional configuration example of the editing device 31 in FIG. In FIG. 5, parts corresponding to those in FIG. 4 are denoted by the same reference numerals, and description thereof is omitted as appropriate.

編集装置31は、制御部91、取得部92、ドライブ47、デコーダ54、デコーダ55、およびエンコーダ59から構成される。   The editing device 31 includes a control unit 91, an acquisition unit 92, a drive 47, a decoder 54, a decoder 55, and an encoder 59.

制御部91は、CPU41およびCPU52から構成され、編集装置31の各部を制御する。取得部92は制御部91の制御に基づいて、HDD46から、またはドライブ47を介して記録メディア48から圧縮映像データを取得してデコーダ54またはデコーダ55に供給する。なお、圧縮映像データが記録されるHDD46が取得部92に含まれるようにしてもよいし、取得部92が編集装置31に接続されている他の装置から上書きデータとしての圧縮映像データを取得するようにしてもよい。   The control unit 91 includes a CPU 41 and a CPU 52 and controls each unit of the editing device 31. The acquisition unit 92 acquires compressed video data from the HDD 46 or the recording medium 48 via the drive 47 based on the control of the control unit 91 and supplies the compressed video data to the decoder 54 or the decoder 55. The HDD 46 in which the compressed video data is recorded may be included in the acquisition unit 92, or the acquisition unit 92 acquires the compressed video data as overwrite data from another device connected to the editing device 31. You may do it.

デコーダ54およびデコーダ55は、取得部92から供給された圧縮映像データをデコードし、その結果として得られた非圧縮の映像信号をエンコーダ59に供給する。なお、図5に示す編集装置31には、圧縮映像データをデコードするデコーダとして、2つのデコーダ54およびデコーダ55が設けられているが、編集装置31に設けられるデコーダは1つであってもよいし、3以上であってもよい。   The decoder 54 and the decoder 55 decode the compressed video data supplied from the acquisition unit 92 and supply the uncompressed video signal obtained as a result to the encoder 59. Note that the editing device 31 shown in FIG. 5 includes two decoders 54 and 55 as decoders for decoding the compressed video data, but the editing device 31 may have only one decoder. 3 or more.

エンコーダ59は、デコーダ54およびデコーダ55においてデコードされ、接続された映像信号をエンコードし、エンコードにより得られた圧縮映像データを、取得部92を介してドライブ47に供給する。   The encoder 59 encodes the connected video signal decoded by the decoder 54 and the decoder 55, and supplies the compressed video data obtained by the encoding to the drive 47 via the acquisition unit 92.

また、制御部91は、より詳細には図6に示すように構成される。   Further, the control unit 91 is configured as shown in FIG. 6 in more detail.

すなわち、制御部91は、CPU41およびCPU52から構成される。また、CPU41は、操作入力取得部121、再エンコード区間決定部122、パラメータ送出部123、およびストリーム送出制御部124から構成され、CPU52は、ストリーム取得制御部125、復号制御部126、パラメータ取得部127、符号化制御部128、およびダミーデータ挿入部129から構成される。   That is, the control unit 91 includes a CPU 41 and a CPU 52. The CPU 41 includes an operation input acquisition unit 121, a re-encode section determination unit 122, a parameter transmission unit 123, and a stream transmission control unit 124. The CPU 52 includes a stream acquisition control unit 125, a decoding control unit 126, and a parameter acquisition unit. 127, an encoding control unit 128, and a dummy data insertion unit 129.

操作入力取得部121は、ユーザによる操作入力を受けて、インサート編集されるストリームおよび編集点に関する情報などのユーザの操作に応じた情報を取得し、取得した情報を再エンコード区間決定部122またはストリーム送出制御部124に供給する。   The operation input acquisition unit 121 receives an operation input by the user, acquires information according to a user operation such as information on a stream to be inserted and edited and edit points, and the acquired information is re-encoded section determination unit 122 or stream This is supplied to the sending control unit 124.

再エンコード区間決定部122は、操作入力取得部121からのインサート編集されるストリームおよび編集点に関する情報に基づいて、再エンコード区間を決定する。再エンコード区間決定部122は、決定された再エンコード区間を示す情報をパラメータ送出部123およびストリーム送出制御部124に供給する。   The re-encode section determination unit 122 determines the re-encode section based on the information about the stream to be edited and the edit point from the operation input acquisition unit 121. The re-encoding section determination unit 122 supplies information indicating the determined re-encoding section to the parameter transmission unit 123 and the stream transmission control unit 124.

パラメータ送出部123は、再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、ストリームの再エンコードに必要な各種のパラメータをパラメータ取得部127に供給する。また、パラメータ送出部123は、クラスタ数算出部141を備えている。クラスタ数算出部141は、再エンコード区間とされるIN点近傍の位置α2から位置β2までの部分、およびOUT点近傍の位置γ2から位置δ2までの部分を記録メディア48に記録する場合に、使用することのできるクラスタの数を算出する。   The parameter transmission unit 123 supplies various parameters necessary for re-encoding the stream to the parameter acquisition unit 127 based on the information indicating the re-encoding interval from the re-encoding interval determining unit 122. The parameter transmission unit 123 includes a cluster number calculation unit 141. The cluster number calculation unit 141 is used when recording the portion from the position α2 to the position β2 near the IN point and the portion from the position γ2 to the position δ2 near the OUT point, which are re-encoding sections, on the recording medium 48. The number of clusters that can be calculated is calculated.

ストリーム送出制御部124は、操作入力取得部121からの情報、および再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、インサート編集されるストリームがデコーダ54またはデコーダ55に送出されるように、取得部92を制御する。また、ストリーム送出制御部124は、操作入力取得部121からの情報、および再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、ストリームの編集または記録などのユーザの操作に応じた処理を行うための制御信号をストリーム取得制御部125に供給する。   Based on the information from the operation input acquisition unit 121 and the information indicating the re-encode section from the re-encode section determination unit 122, the stream transmission control unit 124 transmits the stream to be edited by editing to the decoder 54 or the decoder 55. Thus, the acquisition unit 92 is controlled. In addition, the stream transmission control unit 124 responds to a user operation such as editing or recording of a stream based on the information from the operation input acquisition unit 121 and the information indicating the re-encoding section from the re-encoding section determining unit 122. A control signal for performing processing is supplied to the stream acquisition control unit 125.

ストリーム取得制御部125は、ストリーム送出制御部124からの制御信号に基づいて、インサート編集されるストリームの取得を制御する。また、ストリーム取得制御部125は、ストリーム送出制御部124からの制御信号に基づいて、復号制御部126にデコードの制御を指示したり、符号化制御部128にエンコードの制御を指示したりする。また、ストリーム取得制御部125は、再エンコード区間のエンコードの結果に基づいて、取得部92としてのメモリ50に一時的に記憶されているストリームC2およびストリームD2のそれぞれに、後述するダミーデータが挿入されるように、ダミーデータ挿入部129にダミーデータの挿入を指示する。   The stream acquisition control unit 125 controls acquisition of a stream to be insert edited based on a control signal from the stream transmission control unit 124. In addition, the stream acquisition control unit 125 instructs the decoding control unit 126 to perform decoding control or instructs the encoding control unit 128 to perform encoding control based on the control signal from the stream transmission control unit 124. In addition, the stream acquisition control unit 125 inserts dummy data, which will be described later, into each of the stream C2 and the stream D2 temporarily stored in the memory 50 as the acquisition unit 92 based on the result of encoding in the re-encoding section. As described above, the dummy data insertion unit 129 is instructed to insert dummy data.

ここで、ダミーデータとは、ストリームC2およびストリームD2が割り当てられたクラスタ数を満たすデータ量となるように、再エンコードによって実際に発生した符号に対して追加されるデータであり、ストリームC2またはストリームD2のデータとされるが、実際に再生には用いられないデータをいう。   Here, the dummy data is data that is added to the code that is actually generated by re-encoding so that the stream C2 and the stream D2 satisfy the number of assigned clusters, and the stream C2 or stream D2 is stream data. Data that is D2 data but is not actually used for reproduction.

復号制御部126は、ストリーム取得制御部125の指示に従って、ストリームのデコードを制御する。パラメータ取得部127は、パラメータ送出部123からストリームの再エンコードに必要な各種のパラメータを取得し、符号化制御部128に供給する。   The decoding control unit 126 controls the decoding of the stream according to the instruction from the stream acquisition control unit 125. The parameter acquisition unit 127 acquires various parameters necessary for re-encoding the stream from the parameter transmission unit 123 and supplies the acquired parameters to the encoding control unit 128.

符号化制御部128は、ストリーム取得制御部125の指示に従い、パラメータ取得部127からのパラメータに基づいて、編集されたストリームの再エンコードを制御する。また、符号化制御部128は、符号量算出部142を備えている。符号量算出部142は、パラメータ取得部127からのパラメータに含まれている、再エンコード区間とされる位置α2から位置β2までの部分、および位置γ2から位置δ2までの部分に対して使用することのできるクラスタの数に基づいて、位置α2から位置β2までの部分、および位置γ2から位置δ2までの部分のそれぞれの目標となる発生符号量を算出する。   The encoding control unit 128 controls the re-encoding of the edited stream based on the parameter from the parameter acquisition unit 127 according to the instruction of the stream acquisition control unit 125. The encoding control unit 128 includes a code amount calculation unit 142. The code amount calculation unit 142 is used for the part from the position α2 to the position β2 and the part from the position γ2 to the position δ2 that are included in the parameters from the parameter acquisition unit 127 and are the re-encoding section. Based on the number of clusters that can be generated, the amount of generated code that is the target of each of the portion from position α2 to position β2 and the portion from position γ2 to position δ2 is calculated.

ダミーデータ挿入部129は、ストリーム取得制御部125の指示に応じて、取得部92に一時的に記憶されているストリームC2およびストリームD2のそれぞれに、ダミーデータを挿入する。   In response to an instruction from the stream acquisition control unit 125, the dummy data insertion unit 129 inserts dummy data into each of the stream C2 and the stream D2 temporarily stored in the acquisition unit 92.

ところで、編集装置31が、図2のストリームE2の区間j2から区間k2までの部分を、ストリームA2の位置α2から位置δ2までの部分に上書きするためには、ストリームE2の区間j2から区間k2までの部分の記録に必要なクラスタ数は、記録メディア48上のストリームA2における位置α2から位置δ2までの部分が記録されているクラスタ数以下とされる必要がある。   By the way, in order for the editing apparatus 31 to overwrite the portion from the position j2 to the section k2 of the stream E2 in FIG. 2 with the portion from the position α2 to the position δ2 of the stream A2, from the section j2 to the section k2 of the stream E2. The number of clusters necessary for recording the part of the recording medium 48 needs to be equal to or less than the number of clusters in which the part from position α2 to position δ2 in the stream A2 on the recording medium 48 is recorded.

ここで、再エンコードされるストリームの1フレーム分、すなわちピクチャ1枚分の圧縮映像データを記録するために必要なクラスタ数は、図7に示すように、そのフレームの符号量によって異なる。なお、図中、横軸は1フレームの符号量を示しており、縦軸はそのフレームの圧縮映像データの記録に必要なクラスタ数を示している。   Here, as shown in FIG. 7, the number of clusters required to record the compressed video data for one frame of the stream to be re-encoded, that is, one picture, differs depending on the code amount of the frame. In the figure, the horizontal axis indicates the code amount of one frame, and the vertical axis indicates the number of clusters necessary for recording the compressed video data of that frame.

図7では、圧縮映像データの記録に必要なクラスタの数は、圧縮映像データのデータ量、すなわちフレームの符号量が一定の量だけ増えるにしたがって1ずつ増加している。したがって、記録メディア48の所定のクラスタ数の記録領域に記録できる最大の符号量は、クラスタ数に比例して直線的に増加する。   In FIG. 7, the number of clusters necessary for recording compressed video data increases by 1 as the data amount of compressed video data, that is, the code amount of a frame increases by a certain amount. Therefore, the maximum code amount that can be recorded in the recording area of the predetermined number of clusters on the recording medium 48 increases linearly in proportion to the number of clusters.

例えば、フレームの符号量が0より多く、所定の量以下である場合は、クラスタ数が1であり、符号量がF1よりも多く、F2以下である場合には、記録に必要なクラスタ数は5個とされる。また、F1からF2までの符号量、すなわち符号量F2−F1により得られる符号量は、1つのクラスタに記録することのできる最大のデータ量、すなわちクラスタの大きさとなる。   For example, when the code amount of a frame is greater than 0 and less than or equal to a predetermined amount, the number of clusters is 1, and when the code amount is greater than F1 and less than or equal to F2, the number of clusters necessary for recording is Five. The code amount from F1 to F2, that is, the code amount obtained by the code amount F2-F1 is the maximum data amount that can be recorded in one cluster, that is, the size of the cluster.

編集装置31は、図2のストリームE2の区間j2から区間k2までの部分の符号量が、ストリームA2における位置α2から位置δ2までの部分が記録されているクラスタ数以下のクラスタ数で記録することができるように、ストリームC2およびストリームD2の再エンコードを行う。   The editing apparatus 31 records the code amount of the part from the section j2 to the section k2 of the stream E2 in FIG. 2 with the number of clusters equal to or less than the number of clusters in which the part from the position α2 to the position δ2 in the stream A2 is recorded. So that the stream C2 and the stream D2 are re-encoded.

例えば、位置α2から位置δ2までのVBVバッファのオキュパンシが図8に示すように遷移し、各ピクチャがクラスタに格納されて記録されている場合、編集装置31は、そのクラスタ数で、ストリームE2の区間j2から区間k2までの部分を記録することができるように、ストリームC2およびストリームD2を再エンコードする。   For example, when the occupancy of the VBV buffer from the position α2 to the position δ2 transitions as shown in FIG. 8 and each picture is stored and recorded in a cluster, the editing device 31 uses the number of clusters and the stream E2 The stream C2 and the stream D2 are re-encoded so that the part from the section j2 to the section k2 can be recorded.

なお、図8において、横軸は時間を示しており、縦軸はVBVバッファのオキュパンシ、すなわち占有量を示している。また、折れ線Z1はVBVバッファのオキュパンシの変化を示しており、図中、1つの長方形は1つのクラスタを示している。   In FIG. 8, the horizontal axis indicates time, and the vertical axis indicates the occupancy of the VBV buffer, that is, the occupation amount. A broken line Z1 indicates a change in the occupancy of the VBV buffer. In the figure, one rectangle indicates one cluster.

また、折れ線Z1の傾きはストリームが伝送されるビットレート、すなわちデコード側の装置において、ストリームがバッファに取り込まれる単位時間当たりの符号量を示している。さらに、図中、折れ線Z1の垂直方向に急激に減少する部分におけるオキュパンシが減少した量は、各フレームの再生のために、フレームを再生する周期でバッファから取り出される各フレーム、すなわち各ピクチャの符号量を示しており、図8の例では10枚のフレームが取り出されている。   The slope of the broken line Z1 indicates the bit rate at which the stream is transmitted, that is, the code amount per unit time at which the stream is taken into the buffer in the decoding side apparatus. Further, in the figure, the amount of decrease in occupancy in the portion where the line Z1 sharply decreases in the vertical direction is the code of each frame, that is, each picture taken out from the buffer in the frame playback period for playback of each frame. In the example of FIG. 8, ten frames are extracted.

したがって、記録メディア48上においては、これらのフレームが図8の長方形に示されるクラスタ内に格納されて記録されており、クラスタ数の合計は52個とされている。ここで、矢印W1乃至W8のそれぞれにより示されるクラスタのそれぞれは、クラスタギャップを有している。すなわち、矢印W1乃至W8により示されるクラスタのそれぞれには、フレームの圧縮映像データが記録されていない領域が存在する。   Therefore, on the recording medium 48, these frames are stored and recorded in clusters indicated by rectangles in FIG. 8, and the total number of clusters is 52. Here, each of the clusters indicated by the arrows W1 to W8 has a cluster gap. That is, in each of the clusters indicated by the arrows W1 to W8, there is an area where the compressed video data of the frame is not recorded.

編集装置31は、ストリームE2の区間j2から区間k2までの符号量が、それらの区間の部分の記録に使用することのできる52個のクラスタに格納して記録することができ、またVBVバッファの連続性が保たれ、かつVBVバッファが破綻しないように、すなわちオーバーフローもアンダーフローもしないようにストリームC2およびストリームD2を再エンコードする。   The editing device 31 can store and record the code amount from the section j2 to the section k2 of the stream E2 in 52 clusters that can be used for recording the portion of the section. Stream C2 and stream D2 are re-encoded so that continuity is maintained and the VBV buffer does not fail, that is, neither overflow nor underflow.

例えば、ストリームA2がCBRによりエンコードされたストリームであり、ストリームC2を、ストリームA2のビットレートと同じビットレートで、VBVバッファの連続性が保たれ、かつVBVバッファが破綻しないようにCBRにより再エンコードした場合に、図9に示すようにVBVバッファのオキュパンシが遷移したとする。   For example, stream A2 is a stream encoded by CBR, and stream C2 is re-encoded by CBR at the same bit rate as stream A2 so that the continuity of the VBV buffer is maintained and the VBV buffer does not fail In this case, it is assumed that the occupancy of the VBV buffer has changed as shown in FIG.

なお、図9において、横軸は時間を示しており、縦軸はVBVバッファのオキュパンシを示している。また、折れ線はVBVバッファのオキュパンシの変化を示している。さらに、OC1は、ストリームA2の位置α2におけるオキュパンシを示しており、OC2は、ストリームB2の位置β2におけるオキュパンシを示している。   In FIG. 9, the horizontal axis indicates time, and the vertical axis indicates the occupancy of the VBV buffer. A broken line indicates a change in the occupancy of the VBV buffer. Further, OC1 indicates the occupancy at the position α2 of the stream A2, and OC2 indicates the occupancy at the position β2 of the stream B2.

図9では、折れ線により示されるように、ストリームC2の開始位置のオキュパンシはOC1であり、ストリームC2の終了位置のオキュパンシはOC2となっているので、ストリームA2およびストリームB2とのオキュパンシの連続性は保たれている。また、折れ線により示されるオキュパンシは、オーバーフローもアンダーフローもしていない。   In FIG. 9, since the occupancy at the start position of the stream C2 is OC1 and the occupancy at the end position of the stream C2 is OC2, as shown by the broken line, the continuity of the occupancy with the stream A2 and the stream B2 is It is kept. Further, the occupancy indicated by the broken line does not overflow or underflow.

しかしながら、ストリームC2のビットレートは、ストリームA2のビットレートと同じであるので、この場合におけるストリームC2の符号量は、ストリームA2の位置α2から位置β2に対応する位置の符号量と同じとなり、予めストリームA2が記録されているクラスタ数では、ストリームC2を記録することができなくなるおそれがある。なお、この場合、ストリームB2のビットレートもストリームA2のビットレートと同じであるものとする。   However, since the bit rate of the stream C2 is the same as the bit rate of the stream A2, the code amount of the stream C2 in this case is the same as the code amount of the position corresponding to the position β2 from the position α2 of the stream A2, There is a possibility that the stream C2 cannot be recorded with the number of clusters in which the stream A2 is recorded. In this case, it is assumed that the bit rate of the stream B2 is the same as the bit rate of the stream A2.

そこで、編集装置31は、図10に示すように、ストリームC2の開始位置のオキュパンシOC1と、終了位置のオキュパンシOC2との差Δ、並びにストリームC2およびストリームD2の記録に用いることのできるクラスタ数に基づいて、再エンコード時におけるストリームC2の目標とする符号量を変更する。   Therefore, as shown in FIG. 10, the editing apparatus 31 sets the difference Δ between the occupancy OC1 at the start position of the stream C2 and the occupancy OC2 at the end position, and the number of clusters that can be used for recording the stream C2 and the stream D2. Based on this, the target code amount of the stream C2 at the time of re-encoding is changed.

なお、図10において、点線で示される折れ線は、図9における折れ線に対応するものであり、図10において実線で示される折れ線は、符号量が変更されたストリームC2のオキュパンシの時間的な変化を示している。   In FIG. 10, the broken line indicated by the dotted line corresponds to the broken line in FIG. 9, and the broken line indicated by the solid line in FIG. 10 represents the temporal change in the occupancy of the stream C2 whose code amount has been changed. Show.

図10では、実線の折れ線における各フレームの圧縮映像データの符号量は、変更前の点線の折れ線における符号量よりも少なくなっている。また、ストリームC2の符号量が変更されたので、これによりビットレートも変化し、実線により示されるオキュパンシの傾きは、点線により示される変更前のオキュパンシの傾きよりも緩やかになっている。すなわち、図10では、実線により示されるオキュパンシのビットレートが、点線で示される変更前の折れ線のオキュパンシのビットレートよりも低いビットレートとなっている。   In FIG. 10, the code amount of the compressed video data of each frame in the solid line is smaller than the code amount in the dotted line before the change. Further, since the code amount of the stream C2 is changed, the bit rate is changed accordingly, and the inclination of the occupancy indicated by the solid line is gentler than the inclination of the occupancy before the change indicated by the dotted line. That is, in FIG. 10, the bit rate of the occupancy indicated by the solid line is lower than the bit rate of the occupancy of the broken line before the change indicated by the dotted line.

同様に編集装置31は、ストリームD2の符号量が減少するように、ストリームD2の再エンコードも行う。このように、必要に応じてストリームC2およびストリームD2の符号量が減少するように、ストリームC2およびストリームD2の再エンコードを行うと、区間j2から区間k2までの部分を、ストリームA2の位置α2から位置δ2の部分に上書きして記録することができるようになる。また、ストリームC2およびストリームD2の符号量も減っているので、アンダーフローも生じることもなく、VBVバッファの破綻は生じない。   Similarly, the editing apparatus 31 also performs re-encoding of the stream D2 so that the code amount of the stream D2 decreases. As described above, when the re-encoding of the stream C2 and the stream D2 is performed so that the code amounts of the stream C2 and the stream D2 are reduced as necessary, the portion from the section j2 to the section k2 is changed from the position α2 of the stream A2. Recording can be performed by overwriting the portion at position δ2. Further, since the code amounts of the stream C2 and the stream D2 are also reduced, underflow does not occur and the VBV buffer does not fail.

なお、ストリームC2およびストリームD2を記録するためのクラスタ数が充分にあり、ストリームC2およびストリームD2の符号量を減らす必要のない場合には、再エンコード時のストリームC2およびストリームD2の目標とする符号量を、そのままの符号量としたり、増加させたりするようにしてもよい。   In addition, when there is a sufficient number of clusters for recording the stream C2 and the stream D2, and it is not necessary to reduce the code amount of the stream C2 and the stream D2, the target code of the stream C2 and the stream D2 at the time of re-encoding The amount may be a code amount as it is or may be increased.

さらに、このようにして符号量が減少するように再エンコードされたストリームC2を、CBRではなくVBR(Variable Bit Rate)でエンコードされたものとし、符号量を変更させなかったときのビットレート、すなわちストリームA2のビットレートと同じビットレートでデコード側の装置のバッファにストリームC2が取り込まれるとしたときのVBVバッファのオキュパンシは、図11に示すように遷移する。   Further, it is assumed that the stream C2 re-encoded so that the code amount is reduced in this way is encoded by VBR (Variable Bit Rate) instead of CBR, and the bit rate when the code amount is not changed, that is, The occupancy of the VBV buffer when the stream C2 is taken into the buffer of the decoding side device at the same bit rate as the stream A2 transitions as shown in FIG.

なお、図11において、点線で示される折れ線は、図10における点線により示される折れ線に対応するものであり、図11において実線で示される折れ線は、符号量が変更されたストリームC2のオキュパンシの時間的な変化を示している。   In FIG. 11, the broken line indicated by the dotted line corresponds to the broken line indicated by the dotted line in FIG. 10, and the broken line indicated by the solid line in FIG. 11 indicates the occupancy time of the stream C2 in which the code amount is changed. Changes.

図11では、実線の折れ線により示されるオキュパンシの終了位置は、オキュパンシOC2よりも大きくなっており、実線の折れ線により示されるストリームC2のオキュパンシは、それ以降のストリームB2のオキュパンシと連続ではなくなっている。しかしながら、この場合、ストリームC2はVBRによりエンコードされたものとして再生されるので、オキュパンシが最大となったとき、すなわちVBVバッファにこれ以上ストリームC2の圧縮映像データを記憶させることができなくなったときには、VBVバッファへの圧縮映像データの取り込みは一時的に停止されるため、VBVバッファがオーバーフローすることはない。   In FIG. 11, the end position of the occupancy indicated by the solid line is larger than the occupancy OC2, and the occupancy of the stream C2 indicated by the solid line is not continuous with the occupancy of the subsequent stream B2. . However, in this case, since the stream C2 is reproduced as encoded by VBR, when the occupancy is maximized, that is, when the compressed video data of the stream C2 can no longer be stored in the VBV buffer, Since the import of the compressed video data into the VBV buffer is temporarily stopped, the VBV buffer does not overflow.

また、実線の折れ線は、符号量が減少するように再エンコードされたストリームC2のオキュパンシの変化を示しており、点線の折れ線における場合よりも符号量が減少している。したがって、点線の折れ線がアンダーフローしていないので、実線の折れ線により示されるオキュパンシにおける場合もアンダーフローすることはない。   The solid broken line indicates the change in the occupancy of the stream C2 re-encoded so that the code amount is reduced, and the code amount is reduced as compared with the dotted line. Therefore, since the dotted broken line does not underflow, the underflow does not occur even in the occupancy indicated by the solid broken line.

このように、再エンコードされるストリームC2およびストリームD2の符号量を変化させることで、VBVバッファを破綻させずにオキュパンシの連続性を保つとともに、下地データであるストリームA2の位置α2から位置δ2までの部分に、上書きデータであるストリームC2、ストリームB2の位置β2から位置γ2までの部分、およびストリームD2を上書きできるようになる。   In this way, by changing the code amounts of the re-encoded stream C2 and stream D2, the continuity of occupancy is maintained without breaking the VBV buffer, and from the position α2 to the position δ2 of the stream A2, which is the background data Can be overwritten with the stream C2, which is the overwrite data, the part from the position β2 to the position γ2 of the stream B2, and the stream D2.

次に、図12のフローチャートを参照して、CPU41の処理について説明する。なお、この処理は、ユーザが図示せぬ操作入力部を操作して、記録メディア48に記録されている圧縮映像データを下地データとするインサート編集を指示すると開始される。   Next, the processing of the CPU 41 will be described with reference to the flowchart of FIG. This process is started when the user operates an operation input unit (not shown) to instruct insert editing using the compressed video data recorded on the recording medium 48 as background data.

ステップS11において、操作入力取得部121は、図示せぬ操作入力部からユーザの操作に応じて、圧縮符号化された下地データであるストリームA2、および上書きデータであるストリームB2のGOP構造、並びに編集点、すなわちIN点およびOUT点を示す情報の入力を受け、入力されたそれらの情報を再エンコード区間決定部122に供給する。   In step S11, the operation input acquisition unit 121 performs a GOP structure of stream A2, which is compression-coded base data, and stream B2, which is overwrite data, and editing in accordance with a user operation from an operation input unit (not shown). The information indicating the points, that is, the IN point and the OUT point is input, and the input information is supplied to the re-encoding section determining unit 122.

ステップS12において、再エンコード区間決定部122は、操作入力取得部121から供給されたストリームA2およびストリームB2のGOP構造、並びに編集点を示す情報に基づいて、再エンコード区間を決定する。再エンコード区間決定部122は、再エンコード区間を決定すると、再エンコード区間を示す情報をパラメータ送出部123およびストリーム送出制御部124に供給する。   In step S12, the re-encode section determination unit 122 determines the re-encode section based on the GOP structures of the stream A2 and the stream B2 supplied from the operation input acquisition unit 121 and the information indicating the edit point. When the re-encoding section determination unit 122 determines the re-encoding section, the re-encoding section determination unit 122 supplies information indicating the re-encoding section to the parameter transmission unit 123 and the stream transmission control unit 124.

例えば、再エンコード区間決定部122は、ストリームA2におけるIN点近傍の位置α2から位置IN2までの部分、およびストリームB2の位置IN3からその近傍の位置β2までの部分からなる区間を、IN点近傍の再エンコード区間とし、ストリームB2におけるOUT点近傍の位置γ2から位置OUT3までの部分、およびストリームA2の位置OUT2からその近傍の位置δ2までの部分からなる区間を、OUT点近傍の再エンコード区間とする。   For example, the re-encoding section determination unit 122 calculates a section including a portion from the position α2 to the position IN2 near the IN point in the stream A2 and a portion from the position IN3 to the position β2 near the stream B2 near the IN point. As a re-encoding section, a section including a portion from the position γ2 to the position OUT3 in the vicinity of the OUT point in the stream B2 and a portion from the position OUT2 to the position δ2 in the vicinity of the stream A2 is set as a re-encoding section in the vicinity of the OUT point. .

なお、図2に示されるIN点近傍の再エンコード区間、およびOUT点近傍の再エンコード区間、すなわちストリームC2およびストリームD2は、それぞれ1GOPとされているが、複数のGOPに分割されるようにしてもよい。また、IN点またはOUT点を含むGOPの開始位置および終了位置が、それぞれ再エンコード区間の開始位置および終了位置とされているが、IN点またはOUT点を含むGOPの所定の数だけ前または後のGOPの開始位置または終了位置が、再エンコード区間の開始位置または終了位置とされてもよい。   Note that the re-encoding interval near the IN point and the re-encoding interval near the OUT point shown in FIG. 2, that is, the stream C2 and the stream D2, are each 1 GOP, but are divided into a plurality of GOPs. Also good. In addition, the start position and end position of the GOP including the IN point or OUT point are the start position and end position of the re-encoding section, respectively, but before or after a predetermined number of GOPs including the IN point or OUT point. The start position or end position of the GOP may be the start position or end position of the re-encoding section.

さらに、IN点近傍の再エンコード区間、およびOUT点近傍の再エンコード区間の終了位置は、GOPの切れ目でなくてもよく、例えば、GOPにおける最初のIピクチャの直前のピクチャまで、すなわちそのIピクチャの直前に配置されているBピクチャまでが再エンコード区間とされるようにしてもよい。   Furthermore, the end position of the re-encoding interval near the IN point and the re-encoding interval near the OUT point may not be a GOP break, for example, up to the picture immediately before the first I picture in the GOP, that is, the I picture A re-encoding section may be set up to the B picture arranged immediately before the.

ステップS13において、クラスタ数算出部141は、下地データにおけるIN点が含まれる再エンコード区間の開始位置から、OUT点が含まれる再エンコード区間の終了位置までのクラスタ数Xを求める。   In step S13, the cluster number calculation unit 141 obtains the cluster number X from the start position of the re-encode section including the IN point in the background data to the end position of the re-encode section including the OUT point.

例えば、クラスタ数算出部141は、必要に応じて記録メディア48に記録されている下地データとしてのストリームA2を参照し、再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、図13に示すように、下地データとしてのストリームA2における、IN点が含まれる再エンコード区間の開始位置α2から、OUT点が含まれる再エンコード区間の終了位置δ2までの区間、すなわち区間b2から区間e2までの区間のクラスタ数Xを求める。換言すれば、クラスタ数算出部141は、記録メディア48における、再エンコードされるストリームA2の区間を含む、上書きデータが挿入される領域のクラスタ数を算出する。   For example, the cluster number calculation unit 141 refers to the stream A2 as background data recorded on the recording medium 48 as necessary, and based on the information indicating the re-encoding interval from the re-encoding interval determining unit 122, 13, in the stream A2 as background data, a section from the re-encoding section start position α2 including the IN point to the re-encoding section end position δ2 including the OUT point, that is, the section b2 to the section e2 The number of clusters X in the interval up to is obtained. In other words, the cluster number calculation unit 141 calculates the number of clusters in the area where the overwrite data is inserted, including the section of the stream A2 to be re-encoded on the recording medium 48.

ステップS14において、クラスタ数算出部141は、上書きデータにおけるIN点が含まれる再エンコード区間の終了位置から、OUT点が含まれる再エンコード区間の開始位置までのクラスタ数Yを求める。   In step S14, the cluster number calculation unit 141 calculates the number of clusters Y from the end position of the re-encode section including the IN point in the overwrite data to the start position of the re-encode section including the OUT point.

例えば、クラスタ数算出部141は、必要に応じてHDD46に記録されている上書きデータとしてのストリームB2を参照し、再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、図13に示すように、上書きデータとしてのストリームB2における、IN点が含まれる再エンコード区間の終了位置β2から、OUT点が含まれる再エンコード区間の開始位置γ2までの区間、すなわち区間g2から区間i2までの区間のクラスタ数Yを求める。   For example, the cluster number calculation unit 141 refers to the stream B2 as the overwrite data recorded in the HDD 46 as necessary, and based on the information indicating the re-encoding interval from the re-encoding interval determining unit 122, the cluster number calculation unit 141 in FIG. As shown, in the stream B2 as the overwriting data, from the end position β2 of the re-encoding section including the IN point to the start position γ2 of the re-encoding section including the OUT point, that is, from the section g2 to the section i2 The number of clusters Y in the section is obtained.

ここで、クラスタ数Yを求めるときのクラスタの大きさ、すなわちクラスタサイズは、記録メディア48に記録されている下地データとしてのストリームA2に対して設定されているクラスタサイズとされる。   Here, the size of the cluster when obtaining the number of clusters Y, that is, the cluster size, is the cluster size set for the stream A2 as the base data recorded on the recording medium 48.

ステップS15において、クラスタ数算出部141は、IN点を含む再エンコード区間、およびOUT点を含む再エンコード区間に対して使用可能なクラスタ数を求める。   In step S15, the cluster number calculation unit 141 obtains the number of clusters that can be used for the re-encoding section including the IN point and the re-encoding section including the OUT point.

例えば、図14に示すように、ストリームA2の位置α2から位置δ2までのクラスタ数Xと、ストリームB2の位置β2から位置γ2までのクラスタ数Yはすでに定まっているため、IN点を含む再エンコード区間である区間j2と、OUT点を含む再エンコード区間である区間k2とにおいて使用することができるクラスタ数は、クラスタ数Xからクラスタ数Yを減算した数、すなわちX−Yとなる。したがって、クラスタ数算出部141は、IN点を含む再エンコード区間、およびOUT点を含む再エンコード区間に対して使用可能なクラスタ数をX−Yを計算することにより算出する。   For example, as shown in FIG. 14, since the number of clusters X from position α2 to position δ2 of stream A2 and the number of clusters Y from position β2 to position γ2 of stream B2 are already determined, re-encoding including the IN point is performed. The number of clusters that can be used in the section j2 that is the section and the section k2 that is the re-encoding section including the OUT point is the number obtained by subtracting the cluster number Y from the cluster number X, that is, XY. Therefore, the cluster number calculation unit 141 calculates the number of usable clusters for the re-encoding section including the IN point and the re-encoding section including the OUT point by calculating XY.

ステップS16において、クラスタ数算出部141は、IN点を含む再エンコード区間、およびOUT点を含む再エンコード区間のそれぞれに対して、使用可能なクラスタ数を割り当てる。   In step S16, the cluster number calculation unit 141 assigns the number of usable clusters to each of the re-encoding section including the IN point and the re-encoding section including the OUT point.

例えば、クラスタ数算出部141は、ステップS15の処理において求めたクラスタ数X−Yを、それぞれの再エンコード区間に含まれるフレーム数の比で按分することにより、IN点を含む再エンコード区間に割り当てるクラスタ数CLIと、OUT点を含む再エンコード区間に割り当てるクラスタ数CLOとを算出して割り当てる。   For example, the cluster number calculation unit 141 assigns the cluster number XY obtained in the process of step S15 to the re-encode section including the IN point by dividing the number of clusters by the ratio of the number of frames included in each re-encode section. The number of clusters CLI and the number of clusters CLO assigned to the re-encoding section including the OUT point are calculated and assigned.

例えば、クラスタ数X−Yが50であり、それぞれの再エンコード区間に含まれるフレーム数が15であった場合、IN点を含む再エンコード区間のフレーム数と、OUT点を含む再エンコード区間のフレーム数とは同じであるので、クラスタ数算出部141は、クラスタ数50を等分して、クラスタ数CLIおよびクラスタ数CLOをそれぞれ25個ずつとする。   For example, when the number of clusters XY is 50 and the number of frames included in each re-encoding section is 15, the number of frames in the re-encoding section including the IN point and the frame of the re-encoding section including the OUT point Since the number is the same, the cluster number calculation unit 141 equally divides the cluster number 50 and sets the cluster number CLI and the cluster number CLO to 25 each.

また、IN点を含む再エンコード区間、およびOUT点を含む再エンコード区間のそれぞれに対して割り当てられるクラスタ数は、2パス法などにより求めるようにしてもよい。この場合、例えば、IN点を含む再エンコード区間、およびOUT点を含む再エンコード区間のストリームをそれぞれエンコーダ59において一度エンコードしておき、それらのエンコードの結果として発生した符号の記録に必要なクラスタ数の比によって、クラスタ数算出部141がクラスタ数X−Yを按分し、クラスタ数CLIおよびクラスタ数CLOを求める。   Further, the number of clusters assigned to each of the re-encoding section including the IN point and the re-encoding section including the OUT point may be obtained by a two-pass method or the like. In this case, for example, the stream of the re-encoding section including the IN point and the re-encoding section including the OUT point is encoded once in the encoder 59, and the number of clusters necessary for recording the codes generated as a result of the encoding. Based on this ratio, the cluster number calculation unit 141 apportions the cluster number XY to obtain the cluster number CLI and the cluster number CLO.

ステップS17において、パラメータ送出部123は、記録メディア48に記録されている下地データ、HDD46に記録されている上書きデータを参照したり、図示せぬ操作入力部からの信号を取得したりすることにより、再エンコード区間の再エンコード処理を実行させるために必要なパラメータを取得する。   In step S17, the parameter sending unit 123 refers to the background data recorded on the recording medium 48 and the overwrite data recorded on the HDD 46, or acquires a signal from an operation input unit (not shown). The parameters necessary for executing the re-encoding process of the re-encoding section are acquired.

ここで、再エンコード区間の再エンコード処理を実行させるために必要なパラメータには、例えば、ストリームA2におけるIN点を含むGOPまでのGOP数など、その位置を示す情報、ストリームA2におけるIN点を含むGOPにおけるIN点の位置IN2を示す情報、ストリームA2におけるOUT点を含むGOPの次のGOPまでのGOP数など、その位置を示す情報、ストリームA2におけるOUT点を含むGOPにおけるOUT点の位置OUT2を示す情報、ストリームB2におけるIN点を含むGOPの次のGOPまでのGOP数など、その位置を示す情報、ストリームB2におけるIN点を含むGOPにおけるIN点の位置IN3を示す情報、ストリームB2におけるOUT点を含むGOPまでのGOP数など、その位置を示す情報、ストリームB2におけるOUT点を含むGOPにおけるOUT点の位置OUT3を示す情報、再エンコード区間のはじめのVBV値および次のGOPの最初のフレームのVBV値(すなわち、再エンコード区間におけるVBV目標値)、エフェクトの有無またはエフェクトの種類を示す情報などがある。   Here, the parameters necessary for executing the re-encoding process in the re-encoding section include information indicating the position, such as the number of GOPs up to the GOP including the IN point in the stream A2, and the IN point in the stream A2. Information indicating the position IN2 of the IN point in the GOP, the number of GOPs up to the next GOP of the GOP including the OUT point in the stream A2, etc., and the position OUT2 of the OUT point in the GOP including the OUT point in the stream A2 Information indicating the position, such as the number of GOPs up to the next GOP of the GOP including the IN point in the stream B2, information indicating the position IN3 of the IN point in the GOP including the IN point in the stream B2, and the OUT point in the stream B2 The information indicating the position, such as the number of GOPs up to the GOP that includes, and the OUT point position OUT3 in the GOP that includes the OUT point in the stream B2 Information, the first VBV value of the frame of the beginning of the VBV value and the next GOP of the re-encoding section (i.e., VBV target value in the re-encoding section), and the like information indicating whether or types of effects of effect.

また、その他、再エンコード処理を実行させるために必要なパラメータには、クラスタの大きさ、IN点を含む再エンコード区間に割り当てられたクラスタ数CLI、およびOUT点を含む再エンコード区間に割り当てられたクラスタ数CLOなども含まれている。さらに、パラメータ送出部123は、ストリーム送出制御部124に、取得したエフェクトの有無またはエフェクトの種類を示す情報を供給する。   In addition, other parameters necessary for executing the re-encoding process are the size of the cluster, the number of clusters CLI allocated to the re-encoding section including the IN point, and the re-encoding section including the OUT point. The number of clusters, CLO, etc. are also included. Further, the parameter transmission unit 123 supplies the stream transmission control unit 124 with information indicating the presence or absence of the acquired effect or the effect type.

ステップS18において、ストリーム送出制御部124は、再エンコード区間決定部122からの再エンコード区間を示す情報に基づいて、再エンコード区間の再エンコード処理を実行させるために必要なストリームのデコーダ54およびデコーダ55への送出を制御する。   In step S18, the stream transmission control unit 124, based on the information indicating the re-encoding period from the re-encoding period determining unit 122, the decoder 54 and the decoder 55 of the stream necessary for executing the re-encoding process of the re-encoding period. Controls sending to

具体的には、ストリーム送出制御部124は、再エンコード区間の再エンコード処理を実行させるために必要なストリーム、すなわち記録メディア48に記録されている下地データとしてのストリームA2の位置α2から位置IN2までの部分、およびストリームA2の位置OUT2から位置δ2までの部分(位置OUT2以降の部分のデコードに必要なフレームが位置OUT2以前に存在する場合は、そのフレームも含む)がデコーダ54に供給され、HDD46に記録されている上書きデータとしてのストリームB2の位置IN3から位置β2までの部分(位置IN3以降の部分のデコードに必要なフレームが位置IN3以前に存在する場合は、そのフレームも含む)、およびストリームB2の位置γ2から位置OUT3までの部分がデコーダ55に供給されるように各部を制御する。   Specifically, the stream transmission control unit 124, from the position α2 to the position IN2 of the stream A2 as the base data recorded on the recording medium 48, that is, the stream necessary for executing the re-encoding process of the re-encoding section. And the portion from the position OUT2 to the position δ2 of the stream A2 (including a frame necessary for decoding the portion after the position OUT2 before the position OUT2) is supplied to the decoder 54, and the HDD 46 A portion from position IN3 to position β2 of stream B2 as overwrite data recorded in (including a frame necessary for decoding a portion after position IN3 before position IN3), and a stream A portion of B2 from position γ2 to position OUT3 is supplied to the decoder 55. Sea urchin and controls each unit.

ドライブ47は、ストリーム送出制御部124の制御に基づいて、記録メディア48からストリームA2の位置α2から位置IN2までの部分、および位置OUT2から位置δ2までの部分を読み出して、サウスブリッジ45、ノースブリッジ42、PCIバス44、およびPCIブリッジ49を介してデコーダ54に供給する。   Based on the control of the stream transmission control unit 124, the drive 47 reads the part from the position α2 to the position IN2 and the part from the position OUT2 to the position δ2 of the stream A2 from the recording medium 48, the south bridge 45, the north bridge 42, the PCI bus 44, and the PCI bridge 49 are supplied to the decoder 54.

また、サウスブリッジ45は、ストリーム送出制御部124の制御に基づいて、HDD46からストリームB2の位置IN3から位置β2までの部分、および位置γ2から位置OUT3までの部分を取得して、ノースブリッジ42、PCIバス44、およびPCIブリッジ49を介してデコーダ55に供給する。   Further, the south bridge 45 acquires the part from the position IN3 to the position β2 and the part from the position γ2 to the position OUT3 of the stream B2 from the HDD 46 based on the control of the stream transmission control unit 124, and the north bridge 42, The data is supplied to the decoder 55 via the PCI bus 44 and the PCI bridge 49.

さらに、ストリーム送出制御部124は、ストリームA2の位置α2から位置IN2までの部分と、ストリームB2の位置IN3から位置β2までの部分とが、それぞれデコーダ54およびデコーダ55においてデコードされ、エフェクト/スイッチ58によってIN点で接続され、必要に応じてエフェクトが施され、さらにエンコーダ59において再エンコードされるように、各部を制御させるための制御信号を生成し、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介して、CPU52に送出する。   Further, the stream transmission control unit 124 decodes the portion from the position α2 to the position IN2 of the stream A2 and the portion from the position IN3 to the position β2 of the stream B2 in the decoder 54 and the decoder 55, respectively. Are connected at the IN point, effects are applied as necessary, and control signals for controlling each part are generated so as to be re-encoded by the encoder 59, and the north bridge 42, PCI bus 44, PCI bridge 49 are generated. And to the CPU 52 via the control bus 51.

同様に、ストリーム送出制御部124は、ストリームA2の位置OUT2から位置δ2までの部分と、ストリームB2の位置γ2から位置OUT3までの部分とが、それぞれデコーダ54およびデコーダ55においてデコードされ、エフェクト/スイッチ58によってOUT点で接続され、必要に応じてエフェクトが施され、さらにエンコーダ59において再エンコードされるように、各部を制御させるための制御信号を生成し、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介してCPU52に送出する。   Similarly, the stream transmission control unit 124 decodes the portion from the position OUT2 to the position δ2 of the stream A2 and the portion from the position γ2 to the position OUT3 of the stream B2 in the decoder 54 and the decoder 55, respectively. 58 is connected at the OUT point, effects are applied as necessary, and control signals for controlling each part are generated so as to be re-encoded in the encoder 59, the north bridge 42, the PCI bus 44, the PCI bridge 49 and the CPU 52 via the control bus 51.

ステップS19において、パラメータ送出部123は、再エンコード区間の再エンコード処理を実行させるために必要なパラメータを、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介して、CPU52に送出する。   In step S <b> 19, the parameter sending unit 123 sends parameters necessary for executing re-encoding processing in the re-encoding section to the CPU 52 via the north bridge 42, the PCI bus 44, the PCI bridge 49, and the control bus 51. To do.

このようにして、ストリームA2およびストリームB2の再エンコードされる部分がエンコーダ59に供給されて再エンコードされると、再エンコードにより得られたストリームC2およびストリームD2は、エンコーダ59から、ストリームスプライサ57およびPCIブリッジ49を介してメモリ50に供給される。   In this way, when the re-encoded portions of the stream A2 and the stream B2 are supplied to the encoder 59 and re-encoded, the stream C2 and the stream D2 obtained by the re-encoding are sent from the encoder 59 to the stream splicer 57. And supplied to the memory 50 via the PCI bridge 49.

また、CPU52のダミーデータ挿入部129は、メモリ50に一時的に記憶されているストリームC2にダミーデータを挿入する。すなわち、ダミーデータ挿入部129は、ストリームC2の符号量が、IN点を含む再エンコード区間、すなわちストリームC2に割り当てられたクラスタ数CLIに記録することができる最大の符号量となるように、ストリームC2にダミーデータを挿入する。さらに、ダミーデータ挿入部129は、メモリ50に一時的に記憶されているストリームD2にも、同様にダミーデータを挿入する。   Further, the dummy data insertion unit 129 of the CPU 52 inserts dummy data into the stream C <b> 2 that is temporarily stored in the memory 50. That is, the dummy data insertion unit 129 sets the stream so that the code amount of the stream C2 becomes the maximum code amount that can be recorded in the re-encoding section including the IN point, that is, the number of clusters CLI allocated to the stream C2. Insert dummy data into C2. Further, the dummy data insertion unit 129 similarly inserts dummy data into the stream D2 temporarily stored in the memory 50.

このようにして、ストリームC2およびストリームD2にダミーデータが挿入されると、ダミーデータが挿入されたストリームC2およびストリームD2のそれぞれの記録に必要なクラスタ数は、それぞれのストリームに割り当てられたクラスタ数CLI、よびクラスタ数CLOとなる。   Thus, when dummy data is inserted into the stream C2 and the stream D2, the number of clusters necessary for recording each of the stream C2 and the stream D2 into which the dummy data is inserted is the number of clusters assigned to each stream. CLI and cluster number CLO.

ストリームC2およびストリームD2がメモリ50に記憶されると、CPU52のストリーム取得制御部125は、再エンコードが終了した旨の信号を生成し、その信号をコントロールバス51、PCIブリッジ49、PCIバス44、およびノースブリッジ42を介してCPU41のストリーム送出制御部124に供給する。   When the stream C2 and the stream D2 are stored in the memory 50, the stream acquisition control unit 125 of the CPU 52 generates a signal indicating that the re-encoding is completed, and the signal is transmitted to the control bus 51, the PCI bridge 49, the PCI bus 44, The data is supplied to the stream transmission control unit 124 of the CPU 41 via the north bridge 42.

ストリーム取得制御部125からストリーム送出制御部124に、再エンコードが終了した旨の信号が供給されると、ステップS20において、ストリーム送出制御部124は、再エンコードにより得られた圧縮映像データであるストリームC2およびストリームD2のメモリ43への転送を制御する。   When a signal indicating that re-encoding has been completed is supplied from the stream acquisition control unit 125 to the stream transmission control unit 124, in step S20, the stream transmission control unit 124 selects a stream that is compressed video data obtained by re-encoding. Controls transfer of C2 and stream D2 to memory 43.

すなわち、ストリーム送出制御部124は、PCIブリッジ49に、メモリ50に記憶されているストリームC2およびストリームD2を取得させ、PCIバス44、およびノースブリッジ42を介してメモリ43に供給させる。   That is, the stream transmission control unit 124 causes the PCI bridge 49 to acquire the stream C2 and the stream D2 stored in the memory 50, and supply the stream 43 to the memory 43 via the PCI bus 44 and the north bridge 42.

ステップS21において、ストリーム送出制御部124は、再エンコード区間を含まない上書きデータとしてのストリームB2のメモリ43への転送を制御する。すなわち、ストリーム送出制御部124は、上書きデータとしてストリームA2に挿入されるストリームB2の位置IN3から位置OUT3の区間のうち、再エンコード区間に含まれない区間g2から区間i2までの部分を、サウスブリッジ45にHDD46から取得させて、ノースブリッジ42を介してメモリ43に供給させる。   In step S <b> 21, the stream transmission control unit 124 controls transfer of the stream B <b> 2 as overwrite data that does not include the re-encode section to the memory 43. In other words, the stream transmission control unit 124 determines the portion from the section g2 to the section i2 that is not included in the re-encoding section among the sections from the position IN3 to the position OUT3 of the stream B2 inserted as the overwrite data in the stream A2. 45 is acquired from the HDD 46 and supplied to the memory 43 via the north bridge 42.

ステップS22において、ストリーム送出制御部124は、メモリ43に記憶されているストリームA2に挿入されるストリーム、すなわちストリームC2、ストリームB2の区間g2から区間i2までの部分、およびストリームD2の記録メディア48への記録を制御し、処理は終了する。   In step S22, the stream transmission control unit 124 inserts the stream inserted into the stream A2 stored in the memory 43, that is, the stream C2, the portion from the section g2 to the section i2 of the stream B2, and the recording medium 48 of the stream D2. The recording is controlled, and the process ends.

より具体的には、ストリーム送出制御部124は、ノースブリッジ42に、メモリ43に記憶されているストリームC2と、ストリームB2の区間g2から区間i2までの部分とを接続させ、さらに、ストリームB2の区間g2から区間i2までの部分と、ストリームD2とを接続させる。そして、ストリーム送出制御部124は、ノースブリッジ42に、メモリ43に記憶されている、それぞれ接続されたストリームC2、ストリームB2の区間g2から区間i2までの部分、およびストリームD2を取得させて、サウスブリッジ45を介してドライブ47に供給させる。また、ドライブ47は、ストリーム送出制御部124の制御の基に、ノースブリッジ42から供給されたストリームC2、ストリームB2の区間g2から区間i2までの部分、およびストリームD2を、記録メディア48におけるストリームA2の位置α2から位置δ2までの部分に上書きさせる。   More specifically, the stream transmission control unit 124 connects the stream C2 stored in the memory 43 to the north bridge 42 and the portion from the section g2 to the section i2 of the stream B2, and further, the stream B2 The stream from the section g2 to the section i2 is connected to the stream D2. Then, the stream transmission control unit 124 causes the north bridge 42 to acquire the connected stream C2, the portion from the section g2 to the section i2 of the stream B2, and the stream D2, which are stored in the memory 43, and the south It is supplied to the drive 47 through the bridge 45. Also, the drive 47 controls the stream C2 supplied from the north bridge 42, the portion from the section g2 to the section i2 of the stream B2, and the stream D2 under the control of the stream transmission control unit 124, and the stream A2 in the recording medium 48. The portion from position α2 to position δ2 is overwritten.

これにより、記録メディア48に記録されているストリームA2の位置α2から位置δ2までの部分が、ストリームC2、ストリームB2の区間g2から区間i2までの部分、およびストリームD2からなるストリームに書き換えられて、ストリームE2とされ、インサート編集が終了する。   Thereby, the part from the position α2 to the position δ2 of the stream A2 recorded on the recording medium 48 is rewritten into a stream consisting of the stream C2, the part from the section g2 to the section i2 of the stream B2, and the stream D2. The stream E2 is set, and the insert editing ends.

ここで、ストリームC2およびストリームD2のそれぞれは、割り当てられたクラスタ数CLI、およびクラスタ数CLOとなるように再エンコードされ、必要に応じてダミーデータが挿入されているので、ストリームC2、ストリームB2の区間g2から区間i2までの部分、およびストリームD2からなるストリームの記録に必要なクラスタ数は、ストリームA2の位置α2から位置δ2までのクラスタ数と一致し、クラスタ数が異なるためにインサート編集において挿入されるストリームが記録できなくなるようなことが防止される。   Here, each of the stream C2 and the stream D2 is re-encoded so as to have the assigned cluster number CLI and the cluster number CLO, and dummy data is inserted as necessary. The number of clusters necessary for recording the stream from section g2 to section i2 and stream D2 is the same as the number of clusters from position α2 to position δ2 of stream A2, and the number of clusters is different. This prevents the recorded stream from being recorded.

このようにして、CPU41は、再エンコード区間に使用することができるクラスタ数を求めて、その求められたクラスタ数で再エンコード区間のストリームが記録できるようにCPU52に再エンコード区間の再エンコードを指示する。そして、CPU41は、再エンコードされたストリームと、上書きデータとしてのストリームB2の再エンコード区間の含まれない部分とが、記録メディア48における下地データに挿入されるように記録を制御する。   In this way, the CPU 41 obtains the number of clusters that can be used for the re-encoding section, and instructs the CPU 52 to re-encode the re-encoding section so that the stream of the re-encoding section can be recorded with the obtained number of clusters. To do. Then, the CPU 41 controls the recording so that the re-encoded stream and the portion not including the re-encoding section of the stream B2 as the overwrite data are inserted into the background data in the recording medium 48.

このように、再エンコード区間に使用することができるクラスタ数を求めて、その求められたクラスタ数で再エンコード区間のストリームが記録できるように再エンコード区間を再エンコードさせることで、下地データにおける上書きデータと置き換えられる部分に、確実に上書きデータを記録させることができる。したがって、記録メディア48に記録できる残りの記録容量が少ない場合であっても、インサート編集を行うことができる。   In this way, the number of clusters that can be used in the re-encoding section is obtained, and the re-encoding section is re-encoded so that the stream of the re-encoding section can be recorded with the obtained number of clusters. Overwrite data can be surely recorded in a portion to be replaced with data. Therefore, even when the remaining recording capacity that can be recorded on the recording medium 48 is small, insert editing can be performed.

このようにして、CPU41からCPU52にストリームの再エンコードを制御するための制御信号が送出されると、CPU52は、その制御信号に応じて、ストリームの再エンコードを制御する処理を開始する。   In this way, when a control signal for controlling the re-encoding of the stream is sent from the CPU 41 to the CPU 52, the CPU 52 starts a process for controlling the re-encoding of the stream in accordance with the control signal.

以下、図15のフローチャートを参照して、CPU52の処理について説明する。   Hereinafter, the processing of the CPU 52 will be described with reference to the flowchart of FIG.

ステップS51において、パラメータ取得部127は、図12のステップS19においてCPU41のパラメータ送出部123により送出された、再エンコード区間の再エンコード処理を実行させるために必要なパラメータを取得し、取得したパラメータを符号化制御部128に供給する。   In step S51, the parameter acquisition unit 127 acquires parameters necessary for executing the re-encoding processing of the re-encoding section, which is transmitted by the parameter transmission unit 123 of the CPU 41 in step S19 of FIG. This is supplied to the encoding control unit 128.

ステップS52において、符号化制御部128の符号量算出部142は、パラメータ取得部127からのパラメータに基づいて、再エンコード区間に対して利用できる符号量を算出する。   In step S <b> 52, the code amount calculation unit 142 of the encoding control unit 128 calculates a code amount that can be used for the re-encoding section based on the parameter from the parameter acquisition unit 127.

例えば、符号量算出部142は、再エンコード処理を実行させるために必要なパラメータに含まれている、IN点が含まれる再エンコード区間のピクチャ数Ni、その再エンコード区間に割り当てられたクラスタ数CLI、クラスタの大きさCS、並びにIN点が含まれる再エンコード区間の始めのVBV値および次のGOPの最初のフレームのVBV値を用いて、IN点が含まれる再エンコード区間に対して利用できる符号量を算出する。   For example, the code amount calculation unit 142 includes the number of pictures Ni in the re-encoding section including the IN point and the number of clusters assigned to the re-encoding section CLI included in the parameters necessary for executing the re-encoding process. , The size CS of the cluster, and the VBV value at the beginning of the re-encoding interval including the IN point and the VBV value of the first frame of the next GOP, the code that can be used for the re-encoding interval including the IN point Calculate the amount.

クラスタの大きさCS、すなわちクラスタサイズCSが、NiByte以上であり、IN点が含まれる再エンコード区間が1GOPとされる場合、Ni個のピクチャを可変長符号化したとき、その結果として得られた符号を記録するために必要なクラスタのうち、クラスタギャップを有するクラスタ(以下、適宜、半端クラスタと称する)の数の範囲は、0乃至Ni個となる。   When the size CS of the cluster, that is, the cluster size CS is NiByte or more and the re-encoding section including the IN point is 1 GOP, when Ni pictures are variable-length encoded, the result is obtained as a result. Of the clusters necessary for recording the code, the range of the number of clusters having a cluster gap (hereinafter referred to as half-end clusters as appropriate) is 0 to Ni.

すなわち、どのピクチャの記録にも半端クラスタが生じる場合、再エンコードされたストリームC2の記録時の半端クラスタの数は最大となり、その数はNi個となる。また、どのピクチャの記録にも半端クラスタが生じない場合、再エンコードされたストリームC2の記録時の半端クラスタの数は最小となり、その数は0個となる。   That is, when a half-end cluster occurs in the recording of any picture, the number of half-end clusters at the time of recording the re-encoded stream C2 is the maximum, and the number is Ni. If no half-end cluster occurs in the recording of any picture, the number of half-end clusters at the time of recording the re-encoded stream C2 is minimized, and the number is zero.

ここで、半端クラスタの数が最小となる場合、つまりストリームC2の符号量が、クラスタサイズCSの整数倍である場合、ストリームC2の全体の符号量を変化させずに、各ピクチャの符号量を変化させて、(Ni−1)個のピクチャの記録時に半端クラスタが生じるように、例えばそれぞれの半端クラスタに1Byteだけデータが記録されるように、(Ni−1)個のピクチャの符号量を増加させたとき、残りの1つのピクチャの符号量は、(Ni−1)個のピクチャの符号量の増加分だけ減少する。   Here, when the number of half-end clusters is minimized, that is, when the code amount of the stream C2 is an integer multiple of the cluster size CS, the code amount of each picture is changed without changing the entire code amount of the stream C2. The code amount of (Ni-1) pictures is changed so that, for example, 1 byte of data is recorded in each half-end cluster so that half-end clusters are generated when (Ni-1) pictures are recorded. When the code amount is increased, the code amount of the remaining one picture is decreased by the increase in the code amount of (Ni-1) pictures.

したがって、ストリームC2の符号量がクラスタサイズCSの整数倍であり、その全体の符号量が変化しないように各ピクチャの符号量を変化させた場合、半端クラスタの数が最小となるときと、最大となるときとのストリームC2の記録に必要なクラスタ数の差は、半端クラスタの数が最小となるとき、すなわち半端クラスタがないときのストリームC2の記録に必要なクラスタ数をXmとして、次式(1)により表すことができる。   Therefore, when the code amount of the stream C2 is an integral multiple of the cluster size CS and the code amount of each picture is changed so that the overall code amount does not change, The difference in the number of clusters necessary for recording the stream C2 from the time when the number of half-end clusters is minimum, that is, the number of clusters necessary for recording the stream C2 when there are no half-end clusters is Xm It can be represented by (1).

(クラスタ数差)=(Xm+(Ni−1))−Xm ・・・(1)   (Cluster number difference) = (Xm + (Ni-1))-Xm (1)

ここで、式(1)の右辺は、Xmと−Xmとが相殺されて(Ni−1)となるので、ストリームC2の符号量がクラスタサイズCSの整数倍である場合、その全体の符号量が変化しないように、各ピクチャの符号量を変化させたときにストリームC2の記録に必要となるクラスタの数の最大数と最小数との差は、(Ni−1)となる。   Here, since the right side of Expression (1) cancels Xm and -Xm and becomes (Ni-1), when the code amount of the stream C2 is an integral multiple of the cluster size CS, the total code amount thereof The difference between the maximum number and the minimum number of clusters required for recording the stream C2 when the code amount of each picture is changed is (Ni-1).

同様に、ストリームC2の記録時の半端クラスタの数が最大となる場合、つまり各ピクチャの記録において半端クラスタが生じる場合、ストリームC2の全体の符号量を変化させずに、各ピクチャの符号量を変化させて、(Ni−1)個のピクチャの記録時に半端クラスタが生じないように、(Ni−1)個のピクチャの符号量を減少させたとき、残りの1つのピクチャの符号量は、(Ni−1)個のピクチャの符号量の減少分だけ増加する。そのような場合、半端クラスタの生じる残りの1つのピクチャの記録に必要なクラスタ数は、クラスタ数が最も増加する場合には(Ni−1)個だけ増加し、最も増加しない場合には、1個も増加しない。   Similarly, when the number of half-end clusters at the time of recording of the stream C2 is the maximum, that is, when half-end clusters occur in the recording of each picture, the code amount of each picture is changed without changing the entire code amount of the stream C2. When the code amount of (Ni-1) pictures is reduced so that a half-end cluster does not occur when recording (Ni-1) pictures, the code amount of the remaining one picture is It increases by a decrease in the code amount of (Ni-1) pictures. In such a case, the number of clusters required for recording the remaining one picture in which a half-end cluster is generated increases by (Ni-1) when the number of clusters increases the most, and 1 when the number of clusters does not increase the most. The number does not increase.

ここで、クラスタ数が最も増加する場合は、全てのピクチャに(CS−1)Byteのデータが記録された半端クラスタが存在する場合であり、最も増加しない場合は、全てのピクチャに、1Byteしかデータの記録されていない半端クラスタが存在する場合である。   Here, when the number of clusters increases the most, it is a case where a half-end cluster in which (CS-1) Byte data is recorded exists in all pictures. When it does not increase the most, only 1 Byte exists in all pictures. This is a case where there is a half-end cluster in which no data is recorded.

したがって、ストリームC2の各ピクチャの記録において半端クラスタが生じる状態であり、その全体の符号量が変化しないように各ピクチャの符号量を変化させた場合、半端クラスタの数が最小となるときと、最大となるときとのストリームC2の記録に必要なクラスタ数の差は、半端クラスタの数が最大となるとき、すなわちピクチャの符号量を変化させる前のストリームC2の記録に必要なクラスタ数をXmとして、次式(2)により表すことができる。   Therefore, a half-end cluster is generated in the recording of each picture of the stream C2, and when the code amount of each picture is changed so that the entire code amount does not change, the number of half-end clusters is minimized. The difference in the number of clusters necessary for recording the stream C2 from the maximum is the number of clusters necessary for recording the stream C2 when the number of odd-numbered clusters is the maximum, that is, before the picture code amount is changed. Can be expressed by the following equation (2).

(クラスタ数差)=Xm−(Xm−(Ni−1)) ・・・(2)   (Cluster number difference) = Xm− (Xm− (Ni−1)) (2)

ここで、式(2)の右辺は、Xmと−Xmとが相殺されて(Ni−1)となるので、各ピクチャの記録において半端クラスタが生じる場合、その全体の符号量が変化しないように、各ピクチャの符号量を変化させたときに、ストリームC2の記録に必要となるクラスタの数の最大数と最小数との差は、(Ni−1)となる。   Here, since the right side of Equation (2) becomes (Ni-1) by canceling Xm and -Xm, when a half-end cluster occurs in recording of each picture, the entire code amount does not change. When the code amount of each picture is changed, the difference between the maximum number and the minimum number of clusters necessary for recording the stream C2 is (Ni-1).

したがって、ピクチャ数がNi個である再エンコード区間のストリームの符号をピクチャごとにクラスタ管理して記録メディア48に記録した場合、ストリームの符号量が変化しないように各ピクチャの符号量を任意に変化させたときに、ストリームの記録に必要なクラスタ数の最大数と最小数との差は、最大で(Ni−1)個となる。   Therefore, when the stream code in the re-encoding section with Ni pictures is cluster-managed for each picture and recorded on the recording medium 48, the code quantity of each picture is arbitrarily changed so that the stream code quantity does not change. In this case, the maximum difference between the maximum number and the minimum number of clusters necessary for stream recording is (Ni-1).

このことから、ストリームC2の再エンコードにおいて、ストリームC2に割り当てられたクラスタ数CLIからクラスタ数差(Ni−1)だけ減算した数のクラスタに記録できる符号量をストリームC2の目標とする符号量とすれば、再エンコードされたストリームC2の記録時にクラスタの数が不足することを防止することができる。換言すれば、ストリームC2の記録に、クラスタギャップにより生じるクラスタ数の不足を調整するためのクラスタとして、予め(Ni−1)個のクラスタを残しておけば、ストリームC2の記録時にクラスタの数が不足することはなくなり、必ずクラスタ数CLI個のクラスタにストリームC2を記録することができる。   Therefore, in the re-encoding of the stream C2, the code amount that can be recorded in the number of clusters obtained by subtracting the cluster number difference (Ni-1) from the cluster number CLI assigned to the stream C2 is the target code amount of the stream C2. By doing so, it is possible to prevent the number of clusters from becoming insufficient when recording the re-encoded stream C2. In other words, if (Ni-1) clusters are left in advance as a cluster for adjusting the shortage of the number of clusters caused by the cluster gap in the recording of the stream C2, the number of clusters at the time of recording the stream C2 There is no shortage, and the stream C2 can always be recorded in the cluster with the number of clusters CLI.

また、ストリームC2が再エンコードされる場合、VBVバッファのオキュパンシが連続となるように、ストリームC2が再エンコードされなければならない。例えば、ストリームA2のエンコード時のビットレートと同じビットレートで、ストリームC2がエンコードされた場合に、ストリームC2のエンコードの開始時のオキュパンシと、ストリームC2の終了時のオキュパンシとが同じになるとすると、ストリームC2の次のGOPの最初のフレームのオキュパンシOCEと、ストリームC2の始めのオキュパンシOCSとの差、すなわちOCE−OCSの値がΔとなるとき、ストリームC2の再エンコード時において、オキュパンシの連続性を保つには、オキュパンシOCSよりも再エンコード区間の終了時のオキュパンシがオキュパンシの差Δだけ大きくなるように、ストリームC2の符号量をΔだけ減らす必要がある。   Also, when the stream C2 is re-encoded, the stream C2 must be re-encoded so that the occupancy of the VBV buffer is continuous. For example, when the stream C2 is encoded at the same bit rate as that of the stream A2, the occupancy at the start of encoding the stream C2 and the occupancy at the end of the stream C2 are the same. When the difference between the occupancy OCE of the first frame of the next GOP of the stream C2 and the occupancy OCS of the start of the stream C2, that is, the value of OCE-OCS is Δ, the occupancy continuity during the re-encoding of the stream C2 Therefore, the code amount of the stream C2 needs to be reduced by Δ so that the occupancy at the end of the re-encoding period is larger than the occupancy OCS by the occupancy difference Δ.

例えば、ストリームC2のオキュパンシの遷移が図10の実線で示される軌跡となるようにするためには、OC2−OC1の値、すなわちオキュパンシの差ΔだけストリームC2の符号量を減少させて、つまりその符号量の減少分だけビットレートを下げてエンコードしなければならない。   For example, in order to make the transition of the occupancy of the stream C2 become the locus shown by the solid line in FIG. 10, the code amount of the stream C2 is decreased by the value of OC2-OC1, that is, the difference occupancy Δ, that is, It is necessary to encode with the bit rate lowered by the amount of decrease in the code amount.

したがって、ストリームC2の再エンコード時に目標とされる発生符号量Gは、ストリームC2に割り当てられたクラスタ数CLIとオキュパンシの差Δとを用いて、式(3)により求めることができる。   Therefore, the generated code amount G targeted at the time of re-encoding of the stream C2 can be obtained by Expression (3) using the cluster number CLI assigned to the stream C2 and the occupancy difference Δ.

G=CS(CLI−(Ni−1))−Δ ・・・(3)   G = CS (CLI− (Ni−1)) − Δ (3)

符号量算出部142は、再エンコード処理を実行させるために必要なパラメータを用いて式(3)を計算することにより、再エンコード区間であるストリームC2に対して利用できる符号量を算出する。   The code amount calculation unit 142 calculates the amount of code that can be used for the stream C2, which is the re-encoding section, by calculating Expression (3) using parameters necessary for executing the re-encoding process.

なお、以上においては、ストリームC2が1GOPにより構成される場合について説明したが、ストリームC2が複数のGOPにより構成される場合においても同様である。例えば、ストリームC2がn個のGOPにより構成され、またストリームC2を構成するピクチャ数がNiであるとすると、VBVバッファのオキュパンシの連続性が保たれるように、CBRによりストリームC2がエンコードされた場合においても、クラスタギャップにより生じるクラスタ数の不足を調整するためのクラスタとして、(Ni−1)個のクラスタを残しておけば、ストリームC2の記録時にクラスタの数が不足することはなくなる。   Although the case where the stream C2 is configured by 1 GOP has been described above, the same applies to the case where the stream C2 is configured by a plurality of GOPs. For example, if stream C2 is composed of n GOPs and the number of pictures constituting stream C2 is Ni, stream C2 is encoded by CBR so that the occupancy continuity of the VBV buffer is maintained. Even in this case, if (Ni-1) clusters are left as clusters for adjusting the shortage of the number of clusters caused by the cluster gap, the number of clusters will not be short when the stream C2 is recorded.

ここで、n個のGOPのそれぞれを構成するピクチャ数を、それぞれN1乃至Nnとすると、ストリームC2を構成するピクチャ数Niは、式(4)により表すことができる。   Here, assuming that the number of pictures constituting each of the n GOPs is N1 to Nn, the number of pictures Ni constituting the stream C2 can be expressed by Expression (4).

Ni=ΣNk ・・・(4)   Ni = ΣNk (4)

式(4)において、ΣNkは、Nkのkを1からnまで変えて総和をとることを表している。ストリームC2がn個のGOPにより構成される場合においても、N1+N2+・・・+Nn−1(=Ni−1)個のクラスタをストリームC2に割り当てられたクラスタ数CLIから減算して得られるクラスタ数で、再エンコードされたストリームC2を記録することができるように、ストリームC2の各GOPに対して符号量が配分される。   In equation (4), ΣNk represents that the sum is obtained by changing k of Nk from 1 to n. Even when the stream C2 is composed of n GOPs, the number of clusters obtained by subtracting N1 + N2 +... + Nn-1 (= Ni-1) clusters from the number of clusters CLI assigned to the stream C2. The code amount is allocated to each GOP of the stream C2 so that the re-encoded stream C2 can be recorded.

また、クラスタサイズCSが、NiByteよりも小さい場合には、クラスタサイズCSが、NiByte以上である場合よりも、各半端クラスタにおけるクラスタギャップは小さくなるため、クラスタギャップにより生じるクラスタ数の不足の調整に必要なクラスタ数は、(Ni−1)個よりも少なくてすむ。したがって、クラスタサイズCSが、NiByteよりも小さい場合においても、ストリームC2の記録に、クラスタギャップにより生じるクラスタ数の不足を調整するためのクラスタとして、(Ni−1)個のクラスタを残しておけば、ストリームC2の記録時にクラスタの数が不足することを防止することができる。   In addition, when the cluster size CS is smaller than NiByte, the cluster gap in each half-end cluster is smaller than when the cluster size CS is NiByte or larger. The number of clusters required is less than (Ni-1). Therefore, even when the cluster size CS is smaller than NiByte, if (Ni-1) clusters are left as the clusters for adjusting the shortage of the number of clusters caused by the cluster gap in the recording of the stream C2. In addition, it is possible to prevent the number of clusters from becoming insufficient when recording the stream C2.

なお、クラスタギャップにより生じるクラスタ数の不足を調整するために予め残されるクラスタ数は、(Ni−1)個より多くてもよい。   Note that the number of clusters remaining in advance for adjusting the shortage of the number of clusters caused by the cluster gap may be larger than (Ni-1).

このようにして、符号量算出部142は、再エンコード区間のストリームC2に対して利用できる符号量を算出する。また、符号量算出部142は、同様に、再エンコード区間のストリームD2に対して利用できる符号量も算出する。   In this way, the code amount calculation unit 142 calculates a code amount that can be used for the stream C2 in the re-encoding section. Similarly, the code amount calculation unit 142 also calculates a code amount that can be used for the stream D2 in the re-encoding section.

再エンコード区間に対して利用できる符号量が算出されると、ステップS53において、符号量算出部142は、再エンコード区間をエンコードするときのビットレートを算出する。   When the code amount that can be used for the re-encoding section is calculated, in step S53, the code amount calculation unit 142 calculates a bit rate for encoding the re-encoding section.

例えば、TM(Test Model)5方式により、これからエンコードされる所定のGOPの目標とする符号量を求める場合、そのGOPを構成するピクチャの数をMとすると、目標とする符号量Gは、式(5)により求めることができる。   For example, when obtaining a target code amount of a predetermined GOP to be encoded in the TM (Test Model) 5 method, assuming that the number of pictures constituting the GOP is M, the target code amount G is given by (5).

G=M×(ビットレート)/(ピクチャレート) ・・・(5)   G = M × (bit rate) / (picture rate) (5)

ここで、式(5)におけるピクチャレートは、そのエンコード区間、つまりGOPにおける1秒あたりのピクチャ数である。例えば、符号量算出部142は、ストリームC2のビットレートを求める場合、式(5)におけるピクチャ数MをストリームC2のピクチャ数Niとし、符号量Gを式(3)により求められる値としたときに、式(5)を満たすビットレートを求め、求められたビットレートを、ストリームC2が再エンコードされるときのビットレートとする。なお、ピクチャレートは、例えば再エンコード処理を実行させるために必要なパラメータに含まれているようにしてもよいし、符号量算出部142が算出するようにしてもよい。   Here, the picture rate in Equation (5) is the number of pictures per second in the encoding section, that is, the GOP. For example, when calculating the bit rate of the stream C2, the code amount calculation unit 142 sets the number of pictures M in Equation (5) to the number of pictures Ni of the stream C2 and the code amount G to a value obtained from Equation (3). Then, a bit rate satisfying Expression (5) is obtained, and the obtained bit rate is set as a bit rate when the stream C2 is re-encoded. Note that the picture rate may be included in parameters necessary for executing the re-encoding process, or may be calculated by the code amount calculation unit 142.

符号量算出部142は、ストリームC2のビットレートを求めると、同様にストリームD2のビットレートも求める。   When the code amount calculation unit 142 obtains the bit rate of the stream C2, it similarly obtains the bit rate of the stream D2.

ステップS54において、符号化制御部128は、IN点が含まれる再エンコード区間のデコードおよびエンコード、並びにIN点の接続を制御する。すなわち、ストリーム取得制御部125は、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介して、CPU41から送出される制御信号に基づいて、ストリームA2の位置α2から位置IN2までの部分の圧縮映像データがデコーダ54においてデコードされ、ストリームB2の位置IN3から位置β2までの部分の圧縮映像データがデコーダ55においてデコードされ、エフェクト/スイッチ58において、デコードにより得られたそれぞれの映像信号がIN点で接続され、必要に応じてエフェクトが施された後、エンコーダ59によってエンコードされるように、エフェクト/スイッチ58の動作を制御するとともに、復号制御部126に対して、デコーダ54およびデコーダ55におけるデコードの制御を指示し、符号化制御部128に対して、エンコーダ59における映像信号のエンコードの制御を指示する。   In step S54, the encoding control unit 128 controls the decoding and encoding of the re-encoding section including the IN point, and the connection of the IN point. That is, the stream acquisition control unit 125 transmits the stream A2 from the position α2 to the position IN2 based on the control signal sent from the CPU 41 via the north bridge 42, the PCI bus 44, the PCI bridge 49, and the control bus 51. A portion of the compressed video data is decoded by the decoder 54, a portion of the compressed video data from position IN3 to position β2 of the stream B2 is decoded by the decoder 55, and each video signal obtained by the decoding is decoded by the effect / switch 58. The operation of the effect / switch 58 is controlled so as to be encoded by the encoder 59 after being connected at the IN point and an effect is applied as necessary. The decoder 54 and the decoder 55 are also controlled with respect to the decoding control unit 126. Decoding control And the encoding control unit 128 is instructed to control the encoding of the video signal in the encoder 59.

また、復号制御部126は、ストリーム取得制御部125からの指示に応じて、デコーダ54およびデコーダ55における圧縮映像データのデコードを制御し、符号化制御部128は、ストリームC2が符号量算出部142により求められたビットレートでエンコードされるように、エンコーダ59における映像信号のエンコードを制御する。   Also, the decoding control unit 126 controls the decoding of the compressed video data in the decoder 54 and the decoder 55 in accordance with an instruction from the stream acquisition control unit 125, and the encoding control unit 128 includes the code amount calculation unit 142 for the stream C2. The encoding of the video signal in the encoder 59 is controlled so as to be encoded at the bit rate obtained by the above.

さらに、このとき、符号化制御部128は、インサート編集されたストリームを再生する装置の設定に応じて、ストリームC2を構成する各GOPの先頭にシーケンスヘッダが挿入され、そのシーケンスヘッダにストリームC2をエンコードしたときのVBV Delayの値か、またはストリームC2をVBRとして再生させるためのVBV Delayの値0xFFFFが挿入されるように、エンコーダ59を制御する。   Further, at this time, the encoding control unit 128 inserts a sequence header at the head of each GOP constituting the stream C2 in accordance with the setting of the apparatus for reproducing the insert edited stream, and adds the stream C2 to the sequence header. The encoder 59 is controlled so that the value of VBV Delay at the time of encoding or the value 0xFFFF of VBV Delay for reproducing the stream C2 as VBR is inserted.

例えば、シーケンスヘッダにストリームC2をエンコードしたときのVBV Delayの値が挿入される場合、下地データとしてのストリームA2、および上書きデータとしてのストリームB2のシーケンスヘッダにも、予めVBV Delayの値が挿入されており、インサート編集されたストリームE2を再生する装置においては、ストリームE2は、CBRによりエンコードされたストリームであるとされて、シーケンスヘッダに挿入されているVBV Delayの値からビットレートが求められ、図10の実線の折れ線で示したように、求められたビットレートでストリームがバッファに取り込まれる。   For example, when the value of VBV Delay when stream C2 is encoded in the sequence header is inserted, the value of VBV Delay is also inserted in advance in the sequence header of stream A2 as background data and stream B2 as overwrite data. In the device that reproduces the stream E2 that has been subjected to the insert editing, the stream E2 is assumed to be a stream encoded by CBR, and the bit rate is obtained from the value of the VBV Delay inserted in the sequence header. As indicated by the solid line in FIG. 10, the stream is taken into the buffer at the determined bit rate.

なお、ストリームE2の各区間はCBRによりエンコードされたストリームであるが、各区間のビットレートは異なるので、ストリームE2全体として考えた場合には、VBRによりエンコードされたストリームとなる。   Each section of the stream E2 is a stream encoded by CBR. However, since the bit rate of each section is different, the stream E2 is a stream encoded by VBR when considered as the entire stream E2.

また、VBV Delayの値として0xFFFFが挿入された場合には、インサート編集されたストリームE2を再生する装置においては、ストリームE2は、VBRによりエンコードされたストリームであるとされて、シーケンスヘッダに挿入されているビットレートの最大値が読み出され、図11の実線の折れ線で示したように、読み出されたビットレートでストリームがバッファに取り込まれる。   In addition, when 0xFFFF is inserted as the value of VBV Delay, in the device that reproduces the stream E2 that has been subjected to insert editing, the stream E2 is assumed to be a stream encoded by VBR and is inserted into the sequence header. The maximum value of the read bit rate is read out, and the stream is taken into the buffer at the read bit rate, as indicated by the solid line in FIG.

なお、再エンコード区間の終了位置が、GOPの切れ目ではなく、GOPにおける、表示順において最初のIピクチャの直前に配置されたBピクチャである場合、符号化制御部128は、ストリームC2の最後のGOPの終了位置までは符号量算出部142により求められたビットレートでエンコードされ、それ以降のBピクチャ、すなわち再エンコード区間の終了位置までは、ストリームA2と同じビットレートでエンコードされるように、エンコーダ59を制御する。   When the end position of the re-encoding section is not a GOP break but a B picture arranged immediately before the first I picture in the display order in the GOP, the encoding control unit 128 determines the last position of the stream C2. Encoding is performed at the bit rate obtained by the code amount calculation unit 142 until the GOP end position, and encoding is performed at the same bit rate as the stream A2 until the subsequent B picture, that is, the end position of the re-encoding section. The encoder 59 is controlled.

ストリーム取得制御部125、復号制御部126、および符号化制御部128のそれぞれが各部を制御すると、デコーダ54およびデコーダ55に供給されたストリームA2の位置α2から位置IN2までの部分、およびストリームB2の位置IN3から位置β2までの部分は、それぞれデコーダ54およびデコーダ55においてデコードされて、エフェクト/スイッチ58に供給される。そして、再エンコードされるストリームA2およびストリームB2は、エフェクト/スイッチ58によりIN点、すなわち位置IN2および位置IN3において接続されてストリームC2とされ、エンコーダ59に供給される。さらに、エンコーダ59に供給されたストリームC2は、エンコーダ59において再エンコードされて、ストリームスプライサ57およびPCIブリッジ49を介してメモリ50に供給され、記憶される。   When each of the stream acquisition control unit 125, the decoding control unit 126, and the encoding control unit 128 controls the respective units, the part from the position α2 to the position IN2 of the stream A2 supplied to the decoder 54 and the decoder 55, and the stream B2 The portions from the position IN3 to the position β2 are decoded by the decoder 54 and the decoder 55, respectively, and supplied to the effect / switch 58. Then, the stream A2 and the stream B2 to be re-encoded are connected to the IN point, that is, the position IN2 and the position IN3 by the effect / switch 58 to become the stream C2, and are supplied to the encoder 59. Further, the stream C2 supplied to the encoder 59 is re-encoded by the encoder 59, supplied to the memory 50 via the stream splicer 57 and the PCI bridge 49, and stored.

ステップS55において、ダミーデータ挿入部129は、IN点が含まれる再エンコード区間に含まれている各GOPに対して、再エンコード区間に割り当てられたクラスタ数CLI個のクラスタのうち、残ったクラスタを配分する。   In step S55, the dummy data insertion unit 129 selects, for each GOP included in the re-encoding section including the IN point, the remaining cluster among the clusters of the CLI number allocated to the re-encoding section. To distribute.

例えば、再エンコード区間のストリームであるストリームC2を再エンコードした結果として、実際に発生した符号を記録するために必要なクラスタ数がCL1であったとする。そのような場合、ストリームC2に割り当てられたクラスタ数CLIからクラスタ数CL1を減算して得られる数のクラスタだけ残ることになる。   For example, it is assumed that the number of clusters necessary for recording the actually generated code as a result of re-encoding the stream C2, which is a stream in the re-encoding section, is CL1. In such a case, only the number of clusters obtained by subtracting the cluster number CL1 from the cluster number CLI assigned to the stream C2 remains.

そこで、ダミーデータ挿入部129は、残ったクラスタを、再エンコード区間を構成する各GOPに配分し、次にインサート編集が行われるときに上書きデータを記録するためのクラスタとして用いることができるようにする。   Therefore, the dummy data insertion unit 129 allocates the remaining cluster to each GOP constituting the re-encoding section so that it can be used as a cluster for recording overwrite data when insert editing is performed next time. To do.

例えば、図16Aに示すように、再エンコード区間が1GOPである場合、残ったクラスタは、全てそのGOPに配分されることになる。なお、図16において、図中、縦方向の線は、ストリームを構成するピクチャが記録されるクラスタの切れ目を示している。また、ピクチャは、図中、左側のピクチャから順番にデコードされるものとする。   For example, as shown in FIG. 16A, when the re-encoding section is 1 GOP, all remaining clusters are allocated to the GOP. In FIG. 16, the vertical lines in the drawing indicate the breaks of clusters in which the pictures constituting the stream are recorded. In addition, the pictures are decoded sequentially from the left picture in the figure.

図16Aでは、ストリームC2は、1つのGOPからなり、残ったクラスタが、そのGOPに配分される。そして、GOPに配分されたクラスタは、矢印H1により示される位置、すなわちGOPの最後の位置に配置され、それらのクラスタにはダミーデータが記録される。なお、ストリームC2が複数のGOPからなる場合においても、ストリームC2を構成する最後のGOPにおける最後の位置に残りのクラスタが配置されるようにしてもよい。   In FIG. 16A, the stream C2 is composed of one GOP, and the remaining clusters are allocated to the GOP. The clusters allocated to the GOP are arranged at the position indicated by the arrow H1, that is, the last position of the GOP, and dummy data is recorded in these clusters. Even when the stream C2 includes a plurality of GOPs, the remaining clusters may be arranged at the last position in the last GOP constituting the stream C2.

また、ストリームC2が複数のGOPからなり、メモリ50に再エンコードされたストリームC2を記憶しておくのに充分な記憶容量がある場合、ストリームC2を再エンコードしたときの残りのクラスタが、ストリームC2を構成する各GOPに対して、それぞれのGOPのピクチャ数の比で按分されるようにしてもよい。   Further, when the stream C2 is composed of a plurality of GOPs and there is a storage capacity sufficient to store the re-encoded stream C2 in the memory 50, the remaining cluster when the stream C2 is re-encoded is the stream C2. May be prorated according to the ratio of the number of pictures in each GOP.

例えば、図16Bに示すように、ストリームC2が2つのGOPA1、およびGOPB1からなる場合、残りのクラスタは、GOPA1のピクチャ数と、GOPB1のピクチャ数との比で按分されて、それぞれGOPA1およびGOPB1の最後に配置される。   For example, as shown in FIG. 16B, when the stream C2 is composed of two GOPA1 and GOPB1, the remaining clusters are prorated according to the ratio of the number of GOPA1 pictures and the number of GOPB1 pictures. Placed at the end.

図16Bの例では、GOPA1は10ピクチャから構成され、GOPB1は15ピクチャから構成されている。この場合、ストリームC2の再エンコード時には24(=10+15−1)個のクラスタが、クラスタギャップにより生じるクラスタ数の不足を調整するためのクラスタとされる。そして、実際にストリームC2を再エンコードした結果、クラスタ数の不足を調整するための24個のクラスタのうち、19個のクラスタがストリームC2の記録に用いられることとなり、最終的にストリームC2に割り当てられたクラスタ数CLIに対して5個のクラスタが残ったとする。   In the example of FIG. 16B, GOPA1 is composed of 10 pictures, and GOPB1 is composed of 15 pictures. In this case, 24 (= 10 + 15-1) clusters at the time of re-encoding of the stream C2 are clusters for adjusting the shortage of the number of clusters caused by the cluster gap. As a result of actually re-encoding the stream C2, 19 clusters are used for recording the stream C2 out of 24 clusters for adjusting the shortage of the number of clusters, and finally allocated to the stream C2. It is assumed that 5 clusters remain for the obtained number of clusters CLI.

このとき、残った5個のクラスタが、GOPA1およびGOPB1のピクチャ数の比、すなわち10対15の比で按分され、GOPA1には2個のクラスタが、GOPB1には3個のクラスタがそれぞれ配分される。そして、GOPA1に配分された2個のクラスタは、矢印H2により示される、GOPA1の後の位置に配置され、それらのクラスタにはダミーデータが記録される。同様に、GOPB1に配分された3個のクラスタは、矢印H3により示される、GOPB1の後の位置に配置され、それらのクラスタにはダミーデータが記録される。   At this time, the remaining five clusters are prorated according to the ratio of the number of pictures of GOPA1 and GOPB1, that is, a ratio of 10 to 15, and two clusters are allocated to GOPA1 and three clusters are allocated to GOPB1. The The two clusters allocated to GOPA1 are arranged at a position after GOPA1 indicated by an arrow H2, and dummy data is recorded in these clusters. Similarly, three clusters allocated to GOPB1 are arranged at a position after GOPB1 indicated by an arrow H3, and dummy data is recorded in these clusters.

また、ピクチャ数比による按分の結果、各GOPに配分されるクラスタ数が整数でないとき、すなわち小数になったときには、小数点以下の数字が大きいものから順番にクラスタが1個ずつ配分される。   When the number of clusters allocated to each GOP is not an integer as a result of apportionment based on the ratio of the number of pictures, that is, when the number of decimals becomes a decimal number, clusters are allocated one by one in descending order of the number after the decimal point.

例えば、残ったクラスタ数が4個である場合、その4個のクラスタをピクチャ数の比で按分すると、GOPA1に配分されるクラスタ数は1.6(=4×10/(10+15))個となり、GOPB1に配分されるクラスタ数は2.4(=4×15/(10+15))個となる。この場合、例えば、GOPA1およびGOPB1のクラスタ数のうち、小数点以下の数字は、GOPA1のクラスタ数の方が大きいので、GOPA1に配分されるクラスタ数の小数以下の数字が切り上げられて2とされ、GOPB1に配分されるクラスタ数の小数以下の数字が切り下げられて2とされ、それぞれ2個ずつクラスタが配分される。   For example, if the number of remaining clusters is 4, when the four clusters are divided by the ratio of the number of pictures, the number of clusters allocated to GOPA1 is 1.6 (= 4 × 10 / (10 + 15)). The number of clusters allocated to GOPB1 is 2.4 (= 4 × 15 / (10 + 15)). In this case, for example, among the number of clusters of GOPA1 and GOPB1, the number after the decimal point is larger than the number of clusters of GOPA1, so the number less than the decimal of the number of clusters allocated to GOPA1 is rounded up to 2, A number less than the decimal of the number of clusters allocated to GOPB1 is rounded down to 2 to allocate 2 clusters each.

このようにして、GOPA1およびGOPB1の最後に配置されたクラスタには、ダミーデータが記録され、次回以降にそのGOPに対してインサート編集されるときに用いられる。すなわち、記録メディア48にGOPA1のデータが記録された場合、矢印H2により示される位置に記録されたダミーデータは、ストリームC2の再生には用いられないが、矢印H2により示される位置に残ったクラスタを配置することによって、インサート編集により、GOPA1の部分に他のストリームが上書きされるときには、最後に配置されたダミーデータのクラスタの分だけ上書きされるストリームの符号量を多くすることができる。   In this way, dummy data is recorded in the cluster arranged at the end of GOPA1 and GOPB1, and is used when insert editing is performed for the GOP after the next time. That is, when GOPA1 data is recorded on the recording medium 48, the dummy data recorded at the position indicated by the arrow H2 is not used for reproduction of the stream C2, but the cluster remaining at the position indicated by the arrow H2 Therefore, when another stream is overwritten in the GOPA1 part by insert editing, the code amount of the stream to be overwritten can be increased by the dummy data cluster arranged last.

また、例えば、残ったクラスタ数が5個であり、その5個のクラスタを全てGOPB1に配分した場合、次回のインサート編集において、GOPB1が記録されている部分に上書きデータを記録するときには、GOPB1に配置された5個のクラスタ分だけより大きい上書きデータを記録させることができるが、逆に、GOPA1が記録されている部分に上書きデータを記録するときには、今回のインサート編集において残った5個のクラスタを有効に用いることができなくなってしまう。   For example, if the number of remaining clusters is 5, and all 5 clusters are allocated to GOPB1, when overwriting data is recorded in the portion where GOPB1 is recorded in the next insert editing, Overwrite data larger than the allocated five clusters can be recorded, but conversely, when overwriting data is recorded in the part where GOPA1 is recorded, the remaining five clusters in the current insert editing are recorded. Cannot be used effectively.

そこで、再エンコード区間を構成するGOPA1およびGOPB1に、残りのクラスタを按分して配分することで、次回以降においてどのGOPがインサート編集の対象となっても、残ったクラスタを有効に用いることができる。   Therefore, by distributing the remaining clusters to the GOPA1 and GOPB1 that make up the re-encoding section, the remaining clusters can be used effectively regardless of which GOP is subject to insert editing from the next time. .

なお、ストリームC2が複数のGOPからなり、ストリームC2を構成する各GOPに対してクラスタを按分して配分することができないような場合には、例えば図16Cに示すように、残りのクラスタが全てGOPB1の最後、すなわち矢印H4により示される位置に配置されるようにしてもよい。   When the stream C2 is composed of a plurality of GOPs and the cluster cannot be apportioned and distributed to each GOP constituting the stream C2, for example, as shown in FIG. It may be arranged at the end of GOPB1, that is, at the position indicated by the arrow H4.

さらに、ストリームC2が複数のGOPからなり、メモリ50に再エンコードされたストリームC2を記憶しておくのに充分な記憶容量がない場合、再エンコードされたストリームC2がこれ以上メモリ50に記憶できなくなったとき、ストリームC2の既にメモリ50に記憶されている部分は、記録メディア48に記録される。   Furthermore, if the stream C2 is composed of a plurality of GOPs and the memory 50 does not have enough storage capacity to store the re-encoded stream C2, the re-encoded stream C2 cannot be stored in the memory 50 any more. When this happens, the portion of the stream C2 already stored in the memory 50 is recorded on the recording medium 48.

そのような場合、ストリームC2のうちまだ再エンコードされていない部分があり、その再エンコードされていない部分の残りのピクチャ数がNrであるとき、ストリームC2のこれから再エンコードされる部分に対する、クラスタ数の不足を調整するために必要なクラスタ数は、多くても(Nr−1)個であるので、再エンコード開始時に求められた、ストリームC2の記録時のクラスタ数の不足を調整するためのクラスタ数をK1とすると、(K1−(Nr−1))(=(K1−1)―Nr)個のクラスタはストリームC2の記録に用いられずに残ることになるので、この残ったクラスタを現時点において、メモリ50に記憶されているストリームC2の部分であって、記録メディア48に記録されるストリームC2の部分に含まれる各GOPに対して、各GOPのピクチャ数の比で按分して配分するようにしてもよい。   In such a case, when there is a part of the stream C2 that has not been re-encoded and the number of remaining pictures of the part that has not been re-encoded is Nr, the number of clusters for the part of the stream C2 that is to be re-encoded Since the number of clusters necessary for adjusting the shortage of (Nr-1) is at most, the cluster for adjusting the shortage of the number of clusters at the time of recording the stream C2 obtained at the start of re-encoding. Assuming that the number is K1, (K1- (Nr-1)) (= (K1-1) -Nr) clusters remain without being used for recording the stream C2. , Each G included in the portion of the stream C2 stored in the memory 50 and recorded in the portion of the stream C2 recorded on the recording medium 48. You may make it distribute equally with OP by the ratio of the number of pictures of each GOP.

なお、再エンコード区間の終了位置がGOPの終了位置ではない場合、例えば、再エンコード区間の開始位置から所定のGOPまでと、さらにそのGOPの次のGOPにおける、表示順において最初のIピクチャまでの1または複数のBピクチャとが再エンコード区間とされる場合、それらのBピクチャはその直前のGOPに含まれるものとし、残ったクラスタは、それらのBピクチャの数も考慮されて、各GOPのピクチャ数比で按分されて配分される。   When the end position of the re-encoding section is not the end position of the GOP, for example, from the start position of the re-encoding section to a predetermined GOP and further to the first I picture in the display order in the next GOP of the GOP. When one or a plurality of B pictures are used as a re-encoding section, these B pictures are included in the immediately preceding GOP, and the remaining clusters are also considered in the number of those B pictures, Prorated by the ratio of the number of pictures.

図15のフローチャートに戻り、残りのクラスタが配分されると、処理はステップS56に進む。ステップS56において、ダミーデータ挿入部129は、ステップS55の処理において各GOPに配分されたクラスタ数に応じて、メモリ50に記憶されている、IN点が含まれる再エンコード区間のストリームにダミーデータを挿入する。   Returning to the flowchart of FIG. 15, when the remaining clusters are allocated, the process proceeds to step S56. In step S56, the dummy data insertion unit 129 adds dummy data to the stream of the re-encoding section including the IN point, which is stored in the memory 50, according to the number of clusters allocated to each GOP in the process of step S55. insert.

例えば、メモリ50に、図16Bに示したストリームC2が記憶されており、GOPA1およびGOPB1にそれぞれ2クラスタずつ配分された場合、ダミーデータ挿入部129は、矢印H2により示されるGOPA1の最後の部分、および矢印H3により示されるGOPB1の最後の部分に、それぞれ2クラスタ分のダミーデータ、すなわち2CS(但し、CSはクラスタサイズ)の大きさのダミーデータを挿入してメモリ50に記憶させる。これにより、GOPA1およびGOPB1からなるストリームC2の大きさは、ちょうどそのストリームC2に割り当てられたクラスタ数CLIに記録できる大きさのデータとなる。   For example, when the stream C2 shown in FIG. 16B is stored in the memory 50 and two clusters are allocated to each of GOPA1 and GOPB1, the dummy data insertion unit 129 has the last part of GOPA1 indicated by the arrow H2, In addition, dummy data for two clusters, that is, dummy data having a size of 2CS (where CS is the cluster size) is inserted into the last portion of GOPB1 indicated by the arrow H3 and stored in the memory 50. As a result, the size of the stream C2 composed of GOPA1 and GOPB1 is just the size of data that can be recorded in the cluster number CLI allocated to the stream C2.

ステップS57において、符号化制御部128は、OUT点が含まれる再エンコード区間のデコードおよびエンコード、並びにOUT点の接続を制御する。すなわち、ストリーム取得制御部125は、ノースブリッジ42、PCIバス44、PCIブリッジ49、およびコントロールバス51を介して、CPU41から送出される制御信号に基づいて、ストリームB2の位置γ2から位置OUT3までの部分の圧縮映像データがデコーダ55においてデコードされ、ストリームA2の位置OUT2から位置δ2までの部分の圧縮映像データがデコーダ54においてデコードされ、エフェクト/スイッチ58によって、デコードにより得られたそれぞれの映像信号がOUT点で接続され、必要に応じてエフェクトが施された後、エンコーダ59によってエンコードされるように、エフェクト/スイッチ58の動作を制御するとともに、復号制御部126に対して、デコーダ54およびデコーダ55におけるデコードの制御を指示し、符号化制御部128に対して、エンコーダ59における映像信号のエンコードの制御を指示する。   In step S57, the encoding control unit 128 controls the decoding and encoding of the re-encoding section including the OUT point and the connection of the OUT point. That is, the stream acquisition control unit 125 transmits the stream B2 from the position γ2 to the position OUT3 based on the control signal sent from the CPU 41 via the north bridge 42, the PCI bus 44, the PCI bridge 49, and the control bus 51. A portion of the compressed video data is decoded by the decoder 55, a portion of the compressed video data from position OUT2 to position δ2 of the stream A2 is decoded by the decoder 54, and the effect / switch 58 converts each video signal obtained by the decoding. The operation of the effect / switch 58 is controlled so as to be encoded by the encoder 59 after being connected at the OUT point and subjected to an effect as necessary, and the decoder 54 and the decoder 55 are controlled with respect to the decoding control unit 126. Instructs decoding control in Then, it instructs the encoding control unit 128 to control the encoding of the video signal in the encoder 59.

また、復号制御部126は、ストリーム取得制御部125からの指示に応じて、デコーダ54およびデコーダ55における圧縮映像データのデコードを制御し、符号化制御部128は、ストリームD2が符号量算出部142により求められたビットレートでエンコードされるように、エンコーダ59における映像信号のエンコードを制御する。   Further, the decoding control unit 126 controls the decoding of the compressed video data in the decoder 54 and the decoder 55 in accordance with the instruction from the stream acquisition control unit 125, and the encoding control unit 128 includes the code amount calculation unit 142 for the stream D2. The encoding of the video signal in the encoder 59 is controlled so as to be encoded at the bit rate obtained by the above.

さらに、このとき、符号化制御部128は、インサート編集されたストリームを再生する装置の設定に応じて、ストリームD2を構成する各GOPの先頭にシーケンスヘッダが挿入され、そのシーケンスヘッダにストリームD2をエンコードしたときのVBV Delayの値か、またはストリームD2をVBRとして再生させるためのVBV Delayの値0xFFFFが挿入されるように、エンコーダ59を制御する。   Further, at this time, the encoding control unit 128 inserts a sequence header at the head of each GOP constituting the stream D2 in accordance with the setting of the apparatus for reproducing the insert edited stream, and the stream D2 is added to the sequence header. The encoder 59 is controlled so that the value of VBV Delay at the time of encoding or the value 0xFFFF of VBV Delay for reproducing the stream D2 as VBR is inserted.

ストリーム取得制御部125、復号制御部126、および符号化制御部128のそれぞれが各部を制御すると、デコーダ54およびデコーダ55に供給されたストリームA2、およびストリームB2は、それぞれデコーダ54およびデコーダ55においてデコードされて、エフェクト/スイッチ58に供給される。そして、再エンコードされるストリームA2およびストリームB2は、エフェクト/スイッチ58によりOUT点、すなわち位置OUT2および位置OUT3において接続されてストリームD2とされ、エンコーダ59に供給される。さらに、エンコーダ59に供給されたストリームD2は、エンコーダ59において再エンコードされて、ストリームスプライサ57およびPCIブリッジ49を介してメモリ50に供給され、記憶される。   When each of the stream acquisition control unit 125, the decoding control unit 126, and the encoding control unit 128 controls the respective units, the stream A2 and the stream B2 supplied to the decoder 54 and the decoder 55 are decoded by the decoder 54 and the decoder 55, respectively. And supplied to the effect / switch 58. Then, the stream A2 and the stream B2 to be re-encoded are connected to the OUT point, that is, the position OUT2 and the position OUT3 by the effect / switch 58 to become the stream D2, and supplied to the encoder 59. Further, the stream D2 supplied to the encoder 59 is re-encoded by the encoder 59, supplied to the memory 50 via the stream splicer 57 and the PCI bridge 49, and stored.

ステップS58において、ダミーデータ挿入部129は、OUT点が含まれる再エンコード区間に含まれている各GOPに対して、再エンコード区間に割り当てられたクラスタ数CLO個のクラスタのうち、残ったクラスタを配分する。   In step S58, the dummy data insertion unit 129, for each GOP included in the re-encoding section including the OUT point, among the CLO clusters assigned to the re-encoding section, the remaining clusters. To distribute.

ステップS59において、ダミーデータ挿入部129は、ステップS58の処理において各GOPに配分されたクラスタ数に応じて、メモリ50に記憶されている、OUT点が含まれる再エンコード区間のストリームにダミーデータを挿入し、処理は終了する。また、ストリーム取得制御部125は、再エンコード区間の再エンコードが終了すると、再エンコードが終了した旨の信号を生成し、コントロールバス51、PCIブリッジ49、PCIバス44、およびノースブリッジ42を介してCPU41に供給する。   In step S59, the dummy data insertion unit 129 adds dummy data to the stream of the re-encoding section including the OUT point, which is stored in the memory 50, according to the number of clusters allocated to each GOP in the process of step S58. Insert, and the process ends. When the re-encoding of the re-encoding section is completed, the stream acquisition control unit 125 generates a signal indicating that the re-encoding is completed, and the stream acquisition control unit 125 passes the control bus 51, the PCI bridge 49, the PCI bus 44, and the north bridge 42. Supply to CPU41.

このようにして、編集装置31は、再エンコード区間に割り当てられたクラスタ数で、再エンコードされたストリームを記録できるように、再エンコード区間のストリームの目標となる符号量を算出して、その符号量を目標としてストリームを再エンコードさせる。   In this way, the editing apparatus 31 calculates the target code amount of the stream in the re-encoding section so that the re-encoded stream can be recorded with the number of clusters allocated to the re-encoding section, and the code Re-encode the stream to target the amount.

このように、再エンコード区間に割り当てられたクラスタ数で、再エンコードされたストリームを記録できるように、再エンコード区間のストリームの目標となる符号量を算出して、その符号量を目標としてストリームを再エンコードさせることで、下地データにおける上書きデータと置き換えられる部分に、確実に上書きデータを記録させることができる。したがって、記録メディア48に記録できる残りの記録容量が少ない場合であっても、インサート編集を行うことができる。   In this way, the target code amount of the stream in the re-encoding section is calculated so that the re-encoded stream can be recorded with the number of clusters allocated to the re-encoding section, and the stream is set with the target code amount as the target. By re-encoding, the overwrite data can be surely recorded in the portion of the base data that is replaced with the overwrite data. Therefore, even when the remaining recording capacity that can be recorded on the recording medium 48 is small, insert editing can be performed.

また、編集により得られたストリームを、記録メディア48の下地データが記録されていない領域に記録する場合には、インサート編集を何度か行っているうちに、記録メディア48に新たにデータを記録することができなくなり、編集後の挿入したいデータを記録することができなくなってしまうが、下地データにおける上書きデータと置き換えられる部分に、確実に上書きデータを記録させることができるように、再エンコード区間のストリームの符号量を定めることによって、何度でもインサート編集を行うことができる。   In addition, when the stream obtained by editing is recorded in an area where the background data of the recording medium 48 is not recorded, new data is recorded on the recording medium 48 while the insert editing is performed several times. Re-encoding section so that overwritten data can be recorded reliably in the part that is replaced with the overwritten data in the base data, but the data to be inserted after editing cannot be recorded. By determining the code amount of the stream, insert editing can be performed any number of times.

以上のように、再エンコード区間に使用することができるクラスタ数を求めて、そのクラスタ数で、再エンコードされたストリームを記録できるように、再エンコード区間のストリームの目標とする符号量を算出し、算出された符号量となるようにストリームを再エンコードさせるようにしたので、下地データの上書きされる部分に確実に上書きデータを記録させることができる。   As described above, the number of clusters that can be used in the re-encoding section is obtained, and the target code amount of the stream in the re-encoding section is calculated so that the re-encoded stream can be recorded with the number of clusters. Since the stream is re-encoded so that the calculated code amount is obtained, the overwrite data can be surely recorded in the overwritten portion of the background data.

なお、記録メディア48に記録される下地データは、CBRによりエンコードされたデータとされてもよいし、VBRによりエンコードされたデータとされてもよいが、下地データがVBRによりエンコードされたデータである場合、CBRでエンコードした場合と比べて局所的に少ない符号量となることがあるので、CBRによりエンコードされたデータとされることが好ましい。   The background data recorded on the recording medium 48 may be data encoded by CBR or may be data encoded by VBR, but the background data is data encoded by VBR. In this case, since the code amount may be locally smaller than that in the case of encoding by CBR, it is preferable that the data is encoded by CBR.

また、以上においては、画像圧縮方式としてMPEGを用いた場合を例として説明しているが、フレーム相関を伴う他の画像圧縮方式により処理を行う場合においても、本発明は適用可能であることはいうまでもない。例えば、AVC(Advanced Video Coding)/H.264などにおいて、本発明は適用可能である。   In the above description, the case where MPEG is used as an image compression method has been described as an example. However, the present invention is applicable even when processing is performed using another image compression method involving frame correlation. Needless to say. For example, AVC (Advanced Video Coding) / H. In the case of H.264, the present invention is applicable.

さらに、以上の説明においては、CPU41とCPU52とが制御信号を授受し、分担して、制御を行うものとして説明したが、例えば、同様の処理を、1つのCPUを用いて実行するようにしてもよい。   Further, in the above description, the CPU 41 and the CPU 52 have been described as transmitting and receiving control signals, sharing them, and performing control. However, for example, the same processing is performed using one CPU. Also good.

上述した一連の処理は、ハードウェアにより実行させることもできるし、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、プログラム記録媒体からインストールされる。   The series of processes described above can be executed by hardware or can be executed by software. When a series of processing is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a program recording medium in a general-purpose personal computer or the like.

図17は、上述した一連の処理をプログラムにより実行するパーソナルコンピュータの構成の例を示すブロック図である。パーソナルコンピュータ301のCPU311は、ROM(Read Only Memory)312、または記録部318に記録されているプログラムに従って各種の処理を実行する。RAM(Random Access Memory)313には、CPU311が実行するプログラムやデータなどが適宜記憶される。これらのCPU311、ROM312、およびRAM313は、バス314により相互に接続されている。   FIG. 17 is a block diagram illustrating an example of the configuration of a personal computer that executes the above-described series of processing using a program. The CPU 311 of the personal computer 301 executes various processes according to a program recorded in a ROM (Read Only Memory) 312 or a recording unit 318. A RAM (Random Access Memory) 313 appropriately stores programs executed by the CPU 311 and data. The CPU 311, ROM 312, and RAM 313 are connected to each other via a bus 314.

CPU311にはまた、バス314を介して入出力インターフェース315が接続されている。入出力インターフェース315には、キーボード、マウス、マイクロホンなどよりなる入力部316、ディスプレイ、スピーカなどよりなる出力部317が接続されている。CPU311は、入力部316から入力される指令に対応して各種の処理を実行する。そして、CPU311は、処理の結果を出力部317に出力する。   An input / output interface 315 is also connected to the CPU 311 via the bus 314. The input / output interface 315 is connected to an input unit 316 including a keyboard, a mouse, and a microphone, and an output unit 317 including a display and a speaker. The CPU 311 executes various processes in response to commands input from the input unit 316. Then, the CPU 311 outputs the processing result to the output unit 317.

入出力インターフェース315に接続されている記録部318は、例えばハードディスクからなり、CPU311が実行するプログラムや各種のデータを記録する。通信部319は、インターネットやローカルエリアネットワークなどのネットワークを介して外部の装置と通信する。   The recording unit 318 connected to the input / output interface 315 includes, for example, a hard disk, and records programs executed by the CPU 311 and various data. The communication unit 319 communicates with an external device via a network such as the Internet or a local area network.

また、通信部319を介してプログラムを取得し、記録部318に記録してもよい。   A program may be acquired via the communication unit 319 and recorded in the recording unit 318.

入出力インターフェース315に接続されているドライブ320は、磁気ディスク、光ディスク、光磁気ディスク、或いは半導体メモリなどのリムーバブルメディア331が装着されたとき、それらを駆動し、そこに記録されているプログラムやデータなどを取得する。取得されたプログラムやデータは、必要に応じて記録部318に転送され、記録される。   The drive 320 connected to the input / output interface 315 drives a removable medium 331 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, and drives the program or data recorded therein. Get etc. The acquired program and data are transferred to the recording unit 318 and recorded as necessary.

コンピュータにインストールされ、コンピュータによって実行可能な状態とされるプログラムを格納するプログラム記録媒体は、図17に示すように、磁気ディスク(フレキシブルディスクを含む)、光ディスク(CD-ROM(Compact Disc-Read Only Memory),DVD(Digital Versatile Disc)を含む)、光磁気ディスクを含む)、もしくは半導体メモリなどよりなるパッケージメディアであるリムーバブルメディア331、または、プログラムが一時的もしくは永続的に格納されるROM312や、記録部318を構成するハードディスクなどにより構成される。プログラム記録媒体へのプログラムの格納は、必要に応じてルータ、モデムなどのインターフェースである通信部319を介して、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の通信媒体を利用して行われる。   As shown in FIG. 17, a program recording medium for storing a program that is installed in a computer and can be executed by the computer is a magnetic disk (including a flexible disk), an optical disk (CD-ROM (Compact Disc-Read Only Memory), DVD (including Digital Versatile Disc), magneto-optical disk), or removable media 331 which is a package medium made of semiconductor memory, or ROM 312 in which a program is temporarily or permanently stored, The recording unit 318 is configured by a hard disk or the like. The program is stored in the program recording medium using a wired or wireless communication medium such as a local area network, the Internet, or digital satellite broadcasting via a communication unit 319 that is an interface such as a router or a modem as necessary. Done.

なお、本明細書において、プログラム記録媒体に格納されるプログラムを記述するステップは、記載された順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。   In the present specification, the step of describing the program stored in the program recording medium is not limited to the processing performed in time series in the described order, but is not necessarily performed in time series. Or the process performed separately is also included.

なお、本発明の実施の形態は、上述した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能である。   The embodiment of the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the gist of the present invention.

カット編集を説明するための図である。It is a figure for demonstrating cut edit. インサート編集を説明するための図である。It is a figure for demonstrating insert edit. ストリームの記録時のクラスタ管理について説明する図である。It is a figure explaining cluster management at the time of recording of a stream. 本発明を適用した編集装置のハードウェアの構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the editing apparatus to which this invention is applied. 編集装置の機能の構成例を示すブロック図である。It is a block diagram which shows the structural example of the function of an editing apparatus. 制御部のより詳細な構成例を示すブロック図である。It is a block diagram which shows the more detailed structural example of a control part. フレームの符号量に対するクラスタ数を説明する図である。It is a figure explaining the number of clusters with respect to the code amount of a flame | frame. 下地データのVBVバッファの遷移について説明する図である。It is a figure explaining the transition of the VBV buffer of background data. 再エンコード時のVBVバッファの遷移について説明する図である。It is a figure explaining the transition of the VBV buffer at the time of re-encoding. 再エンコード時のVBVバッファの遷移について説明する図である。It is a figure explaining the transition of the VBV buffer at the time of re-encoding. 再エンコード時のVBVバッファの遷移について説明する図である。It is a figure explaining the transition of the VBV buffer at the time of re-encoding. CPUの処理について説明するフローチャートである。It is a flowchart explaining the process of CPU. 再エンコード区間に使用できるクラスタ数について説明する図である。It is a figure explaining the number of clusters which can be used for a re-encoding area. 再エンコード区間について説明する図である。It is a figure explaining a re-encoding area. CPUの処理について説明する図である。It is a figure explaining the process of CPU. 残りのクラスタの配分について説明する図である。It is a figure explaining distribution of the remaining clusters. パーソナルコンピュータの構成例を示すブロック図である。And FIG. 16 is a block diagram illustrating a configuration example of a personal computer.

符号の説明Explanation of symbols

31 編集装置, 41 CPU, 46 HDD, 47 ドライブ, 48 記録メディア, 52 CPU, 54乃至56 デコーダ, 58 エフェクト/スイッチ, 59 エンコーダ, 91 制御部, 92 取得部, 121 操作入力取得部, 122 再エンコード区間決定部, 123 パラメータ送出部, 124 ストリーム送出制御部, 125 ストリーム取得制御部, 126 復号制御部, 127 パラメータ取得部, 128 符号化制御部, 129 ダミーデータ挿入部, 141 クラスタ数算出部, 142 符号量算出部   31 editing device, 41 CPU, 46 HDD, 47 drive, 48 recording medium, 52 CPU, 54 to 56 decoder, 58 effect / switch, 59 encoder, 91 control unit, 92 acquisition unit, 121 operation input acquisition unit, 122 re-encoding Section determination unit, 123 parameter transmission unit, 124 stream transmission control unit, 125 stream acquisition control unit, 126 decoding control unit, 127 parameter acquisition unit, 128 encoding control unit, 129 dummy data insertion unit, 141 cluster number calculation unit, 142 Code amount calculation unit

Claims (10)

記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理装置において、
前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、
前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出するクラスタ数算出手段と、
前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する再エンコード手段と、
前記クラスタ数算出手段により算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出する符号量算出手段と、
前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記再エンコード手段による再エンコードを制御する再エンコード制御手段と
を備える情報処理装置。
In an information processing apparatus that performs re-encoding by setting a target code amount when recording a second encoded stream in a predetermined section of the first encoded stream recorded on a recording medium,
The first encoded stream from the first position before the IN point that is the start position of the predetermined section to the second position after the OUT point that is the end position of the predetermined section. Recording from the first number of clusters required for recording and the third position near the start position of the second encoded stream to the fourth position near the end position of the second encoded stream And the second number of clusters required for
The video signal obtained by decoding the first encoded stream from the first position to the IN point, and the second signal from the start position of the second encoded stream to the third position. A first video signal connected to a video signal obtained by decoding the encoded stream, and the second encoded stream from the fourth position to the end position of the second encoded stream. For recording a second video signal obtained by decoding the video signal obtained by decoding the video signal obtained by decoding the first encoded stream from the OUT point to the second position. Cluster number calculating means for calculating a third number of clusters that can be used;
Re-encoding means for re-encoding the first video signal and the second video signal to generate a first re-encoded stream and a second re-encoded stream;
Code amount calculation means for calculating a target code amount when re-encoding the first video signal and the second video signal using the third cluster number calculated by the cluster number calculation means;
Re-encoding control means for controlling re-encoding by the re-encoding means so that a generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. Information processing device.
前記再エンコード手段により生成された前記第1の再符号化ストリーム、前記第3の位置から前記第4の位置までの前記第2の符号化ストリーム、および前記第2の再符号化ストリームをそれぞれ接続して、前記記録メディアにおける前記第1の位置から前記第2の位置までの前記第1の符号化ストリームが記録されている位置に記録する記録手段をさらに備える
請求項1に記載の情報処理装置。
The first re-encoded stream generated by the re-encoding means, the second encoded stream from the third position to the fourth position, and the second re-encoded stream are respectively connected The information processing apparatus according to claim 1, further comprising a recording unit configured to record at a position where the first encoded stream from the first position to the second position is recorded on the recording medium. .
前記クラスタ数算出手段は、前記第3のクラスタ数を用いて、前記第1の映像信号の記録に用いることのできる第4のクラスタ数と、前記第2の映像信号の記録に用いることのできる第5のクラスタ数とをさらに求め、
前記符号量算出手段は、
前記第4のクラスタ数から、前記第1の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第6のクラスタ数に基づいて、前記第1の映像信号の前記目標符号量を算出し、
前記第5のクラスタ数から、前記第2の映像信号のピクチャ数よりも1だけ少ない数を減算して得られる第7のクラスタ数に基づいて、前記第2の映像信号の前記目標符号量を算出する
請求項1に記載の情報処理装置。
The cluster number calculating means can be used for recording the fourth video signal that can be used for recording the first video signal and the second video signal by using the third cluster number. Further determining the fifth cluster number,
The code amount calculation means includes:
The target code amount of the first video signal is calculated based on a sixth cluster number obtained by subtracting one less than the number of pictures of the first video signal from the fourth cluster number. Calculate
The target code amount of the second video signal is calculated based on a seventh cluster number obtained by subtracting one less than the number of pictures of the second video signal from the fifth cluster number. The information processing apparatus according to claim 1.
前記第1の符号化ストリーム、前記第2の符号化ストリーム、前記第1の再符号化ストリーム、および前記第2の再符号化ストリームは、MPEG規格に準じている
請求項3に記載の情報処理装置。
The information processing according to claim 3, wherein the first encoded stream, the second encoded stream, the first re-encoded stream, and the second re-encoded stream conform to an MPEG standard. apparatus.
前記符号量算出手段は、
前記第6のクラスタ数に、クラスタサイズを乗算して得られる値から、前記第1の位置におけるVBV(Video Buffering Verifier)バッファのオキュパンシと前記第3の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第1の映像信号の前記目標符号量として算出し、
前記第7のクラスタ数に、前記クラスタサイズを乗算して得られる値から、前記第4の位置におけるVBVバッファのオキュパンシと前記第2の位置におけるVBVバッファのオキュパンシとの差を減算して得られた値を前記第2の映像信号の前記目標符号量として算出する
請求項4に記載の情報処理装置。
The code amount calculation means includes:
The difference between the VBV (Video Buffering Verifier) buffer occupancy at the first position and the VBV buffer occupancy at the third position is subtracted from a value obtained by multiplying the sixth cluster number by the cluster size. The value obtained as a result is calculated as the target code amount of the first video signal,
Obtained by subtracting the difference between the VBV buffer occupancy at the fourth position and the VBV buffer occupancy at the second position from the value obtained by multiplying the seventh cluster number by the cluster size. The information processing apparatus according to claim 4, wherein the calculated value is calculated as the target code amount of the second video signal.
前記符号量算出手段は、さらに、前記第1の映像信号の前記目標符号量を用いて、前記第1の映像信号が再エンコードされるときのビットレートを算出し、前記第2の映像信号の前記目標符号量を用いて、前記第2の映像信号が再エンコードされるときのビットレートを算出する
請求項5に記載の情報処装置。
The code amount calculating means further calculates a bit rate when the first video signal is re-encoded using the target code amount of the first video signal, and The information processing apparatus according to claim 5, wherein a bit rate at which the second video signal is re-encoded is calculated using the target code amount.
前記第4のクラスタ数と、前記第1の再符号化ストリームの記録に必要とされるクラスタ数との差である第1の残りクラスタ数を求め、前記第1の残りクラスタ数を、前記第1の再符号化ストリームを構成する各GOP(Group of Picture)に配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入し、
前記第5のクラスタ数と、前記第2の再符号化ストリームの記録に必要とされるクラスタ数との差である第2の残りクラスタ数を求め、前記第2の残りクラスタ数を、前記第2の再符号化ストリームを構成する各GOPに配分して、各GOPに配分されたクラスタ数分のダミーデータをそれらのGOPの最後に挿入する挿入手段をさらに備える
請求項3に記載の情報処理装置。
A first remaining cluster number that is a difference between the fourth cluster number and the number of clusters required for recording the first re-encoded stream is obtained, and the first remaining cluster number is calculated as the first remaining cluster number. Distributed to each GOP (Group of Picture) constituting one re-encoded stream, and inserts dummy data for the number of clusters allocated to each GOP at the end of those GOPs,
A second remaining cluster number, which is a difference between the fifth cluster number and the number of clusters required for recording the second re-encoded stream, is obtained, and the second remaining cluster number is calculated as the second remaining cluster number. The information processing according to claim 3, further comprising: an inserting unit that allocates the dummy data corresponding to the number of clusters allocated to each GOP at the end of those GOPs allocated to each GOP constituting the two re-encoded streams. apparatus.
記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理装置の情報処理方法において、
前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、
前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出し、
算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出し、
前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードを制御し、
前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する
ステップをむ情報処理方法。
In the information processing method of the information processing apparatus for performing re-encoding by setting a target code amount when recording the second encoded stream in a predetermined section of the first encoded stream recorded on the recording medium,
The first encoded stream from the first position before the IN point that is the start position of the predetermined section to the second position after the OUT point that is the end position of the predetermined section. Recording from the first number of clusters required for recording and the third position near the start position of the second encoded stream to the fourth position near the end position of the second encoded stream And the second number of clusters required for
The video signal obtained by decoding the first encoded stream from the first position to the IN point, and the second signal from the start position of the second encoded stream to the third position. A first video signal connected to a video signal obtained by decoding the encoded stream, and the second encoded stream from the fourth position to the end position of the second encoded stream. For recording a second video signal obtained by decoding the video signal obtained by decoding the video signal obtained by decoding the first encoded stream from the OUT point to the second position. Calculate the number of third clusters that can be used,
Using the calculated third cluster number, a target code amount for re-encoding the first video signal and the second video signal is calculated,
Re-encoding of the first video signal and the second video signal is performed so that a generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. Control
An information processing method including a step of re-encoding the first video signal and the second video signal to generate a first re-encoded stream and a second re-encoded stream.
記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理をコンピュータに実行させるためのプログラムであって、
前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、
前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出し、
算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出し、
前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードを制御し、
前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する
ステップを含むプログラム。
For causing a computer to execute information processing for setting a target code amount and performing re-encoding when recording a second encoded stream in a predetermined section of the first encoded stream recorded on a recording medium A program,
The first encoded stream from the first position before the IN point that is the start position of the predetermined section to the second position after the OUT point that is the end position of the predetermined section. Recording from the first number of clusters required for recording and the third position near the start position of the second encoded stream to the fourth position near the end position of the second encoded stream And the second number of clusters required for
The video signal obtained by decoding the first encoded stream from the first position to the IN point, and the second signal from the start position of the second encoded stream to the third position. A first video signal connected to a video signal obtained by decoding the encoded stream, and the second encoded stream from the fourth position to the end position of the second encoded stream. For recording a second video signal obtained by decoding the video signal obtained by decoding the video signal obtained by decoding the first encoded stream from the OUT point to the second position. Calculate the number of third clusters that can be used,
Using the calculated third cluster number, a target code amount for re-encoding the first video signal and the second video signal is calculated,
Re-encoding of the first video signal and the second video signal is performed so that a generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. Control
A program including the step of re-encoding the first video signal and the second video signal to generate a first re-encoded stream and a second re-encoded stream.
記録メディアに記録されている第1の符号化ストリームの所定の区間に、第2の符号化ストリームを記録する際に目標符号量を設定して再エンコードを行う情報処理をコンピュータに実行させるためのプログラムであって、
前記所定の区間の開始位置であるIN点よりも前の第1の位置から、前記所定の区間の終了位置であるOUT点よりも後の第2の位置までの前記第1の符号化ストリームの記録に必要とされる第1のクラスタ数と、前記第2の符号化ストリームの開始位置近傍の第3の位置から、前記第2の符号化ストリームの終了位置近傍の第4の位置までの記録に必要とされる第2のクラスタ数とを用いて、
前記第1の位置から前記IN点までの前記第1の符号化ストリームがデコードされて得られた映像信号と前記第2の符号化ストリームの開始位置から前記第3の位置までの前記第2の符号化ストリームがデコードされて得られた映像信号とが接続された第1の映像信号、および、前記第4の位置から前記第2の符号化ストリームの終了位置までの前記第2の符号化ストリームがデコードされて得られた映像信号と前記OUT点から前記第2の位置までの前記第1の符号化ストリームがデコードされて得られた映像信号とが接続された第2の映像信号の記録に用いることのできる第3のクラスタ数を算出し、
算出された前記第3のクラスタ数を用いて、前記第1の映像信号および前記第2の映像信号を再エンコードする際の目標符号量を算出し、
前記第1の映像信号および前記第2の映像信号が再エンコードされて得られる発生符号量が前記目標符号量となるように、前記第1の映像信号および前記第2の映像信号の再エンコードを制御し、
前記第1の映像信号および前記第2の映像信号を再エンコードして、第1の再符号化ストリームおよび第2の再符号化ストリームを生成する
ステップを含むプログラムが記録されている記録媒体。
For causing a computer to execute information processing for setting a target code amount and performing re-encoding when recording a second encoded stream in a predetermined section of the first encoded stream recorded on a recording medium A program,
The first encoded stream from the first position before the IN point that is the start position of the predetermined section to the second position after the OUT point that is the end position of the predetermined section. Recording from the first number of clusters required for recording and the third position near the start position of the second encoded stream to the fourth position near the end position of the second encoded stream And the second number of clusters required for
The video signal obtained by decoding the first encoded stream from the first position to the IN point, and the second signal from the start position of the second encoded stream to the third position. A first video signal connected to a video signal obtained by decoding the encoded stream, and the second encoded stream from the fourth position to the end position of the second encoded stream. For recording a second video signal obtained by decoding the video signal obtained by decoding the video signal obtained by decoding the first encoded stream from the OUT point to the second position. Calculate the number of third clusters that can be used,
Using the calculated third cluster number, a target code amount for re-encoding the first video signal and the second video signal is calculated,
Re-encoding of the first video signal and the second video signal is performed so that a generated code amount obtained by re-encoding the first video signal and the second video signal becomes the target code amount. Control
A recording medium on which a program including a step of re-encoding the first video signal and the second video signal to generate a first re-encoded stream and a second re-encoded stream is recorded.
JP2006240302A 2006-09-05 2006-09-05 Information processor and information processing method, recording medium, and program Withdrawn JP2008066852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006240302A JP2008066852A (en) 2006-09-05 2006-09-05 Information processor and information processing method, recording medium, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006240302A JP2008066852A (en) 2006-09-05 2006-09-05 Information processor and information processing method, recording medium, and program

Publications (1)

Publication Number Publication Date
JP2008066852A true JP2008066852A (en) 2008-03-21

Family

ID=39289205

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006240302A Withdrawn JP2008066852A (en) 2006-09-05 2006-09-05 Information processor and information processing method, recording medium, and program

Country Status (1)

Country Link
JP (1) JP2008066852A (en)

Similar Documents

Publication Publication Date Title
JP4221676B2 (en) Information processing apparatus, information processing method, recording medium, and program
JP4207072B2 (en) Information processing apparatus, information processing method, recording medium, and program
KR100834322B1 (en) Image encoding apparatus, picture encoding method and image editing apparatus
KR101119685B1 (en) Information processing apparatus, information processing method, and recording medium
US8798162B2 (en) Encoding method, decoding method, encoder, and decoder
JP2010061803A (en) Audio/video recording apparatus, recording method, playback apparatus, playback method, playback program, and recording program
EP0869679A2 (en) Encoding, decoding and editing
KR100950540B1 (en) User selectable variable trick mode speed
JP4797974B2 (en) Imaging device
JPH11289541A (en) Moving image coding method, moving image coder and recording medium
JP5088215B2 (en) Information processing system, information processing method, and program
JP3918332B2 (en) Multiplexer, multiplexing method, and recording medium
JP2008066852A (en) Information processor and information processing method, recording medium, and program
JP2007028212A (en) Reproducing device and reproducing method
JP2007259493A (en) Encoding device and encoding method
JP4539755B2 (en) Information processing system, information processing method, and program
JP2008262609A (en) Information processor and information processing method, program storing medium, and program
JP2008262610A (en) Information processor and information processing method, program storing medium, and program
JP3443391B2 (en) Digital decoding method
JP2008177874A (en) Recorder, recording method, program, and storage medium
JP2000316158A (en) Encoding device and its method
KR20010007567A (en) Digital decoding method
JP2009260436A (en) Information processing unit and information processing method, and program
JP2008066845A (en) Information processing apparatus and method, recording medium, and program
JP2010252394A (en) Image coding apparatus, image coding method, and image editing apparatus

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20091110