Information
-
Patent Application
-
20040264566
-
Publication Number
20040264566
-
Date Filed
June 04, 200420 years ago
-
Date Published
December 30, 200419 years ago
-
CPC
-
US Classifications
-
International Classifications
Abstract
An encoder to encode video streams representing a moving picture is provided whose video encoder calculates a bit storage quantity an STD video buffer should have when input of a stream ending with a first picture to the STD video buffer ends, calculates an initial bit storage quantity of a second picture of a stream concatenated to the end of the first picture and starting with the second picture, in a VBV buffer, based on the calculated bit storage quantity of the STD buffer, and encodes the stream based on the bit storage quantity. The video encoder further calculates a bit storage quantity of the STD video buffer, for decoding a picture of the stream in the STD video buffer, calculates, based on the calculated bit storage quantity, a bit storage quantity the VBV buffer should have for ending decoding of a fourth picture of a second stream concatenated to the beginning of a third picture and ending with the fourth picture, and encodes the stream based on the calculated bit storage quantity. With such encoding, a part of video streams can be re-coded without referencing to information indicative of an initial status of a video buffer when editing the video streams.
Description
BACKGROUND OF THE INVENTION
[0001] 1. Field of the Invention
[0002] The present invention relates to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, and more particularly, to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, capable of re-encoding, for edition of a video stream, the video stream without reference to information indicative of an initial status of a video buffer when re-encoding a part of the video stream.
[0003] 2. Description of the Related Art
[0004] There is available the MPEG (Moving Picture coding Experts Group) standard as one of the techniques for encoding video streams representing a moving picture. The MPEG standard prescribes a virtual decoder model for connection to the output of an encoder. More specifically, to prevent any underflowing and overflowing of a buffer in the decoder model, to which an encoded video stream is supplied, the MPEG standard limits the buffer capacity anticipated when encoding the video stream. By thus limiting the occupancy by stored data of the buffer included in the decoder model, the MPEG defines a limitation imposed on the encoding of a video stream. The virtual decoder model is called “VBV (Video Buffering Verifier)” and the buffer in the virtual decoder is called “VBV buffer”.
[0005] For conformity with the requirements prescribed in the MPEG standard, a video stream should be encoded for neither underflowing nor overflowing of the VBV buffer. For example MP@ML (Main Profile at Main Level) of the MPEG-2 standard, the VBV buffer size is defined as 1.75 Mbits.
[0006] The encoder encodes a 16-bit field included in each picture and called “information indicative of an initial status of a video buffer” indicative of an initial status of the buffer at a random access. The information indicative of an initial status of a video buffer has a value representing a bit storage quantity (bit occupancy) the VBV buffer should have for decoding the picture. When decoding a picture, the virtual decoder reads a information indicative of an initial status of a video buffer appended to the picture, and then decodes the picture when the VBV buffer has a bit storage quantity represented by the information indicative of an initial status of a video buffer.
[0007] When editing two video streams encoded according to the MPEG standard to concatenate them with an accuracy of pictures, a few pictures before and after an edit point which is a concatenation between the two video streams are re-encoded in some cases. For a picture reproduction with a decoding of the edited video streams with no seam between them by the decoder, it is necessary that the video streams should have been edited and re-encoded for no overflowing and underflowing of the VBV buffer. To this end, an outpoint-side picture, in the edited video stream, positioned temporally before the edit point and an inpoint-side picture positioned temporally after the edit point are re-encoded as will be described below:
[0008] To re-encode an outpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture before a first picture to be re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate an initial bit storage quantity the VBV buffer should have for re-encoding the first picture to re-encoded by the VBV. Then, based on the computed initial bit storage quantity, the encoder re-encodes the pictures according to the VBV model.
[0009] Also, to re-encode an inpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture next to a last picture to re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate a bit storage quantity the VBV buffer should have for the last picture to re-encode by the VBV. Then, the encoder re-encodes the picture from the computed bit storage quantity according to the VBV model.
[0010] The MPEG-2 standard prescribes that it may optionally be selected whether or not information indicative of an initial status of a video buffer value should be encoded to be header information of a picture layer and included in a video stream. Therefore, in many cases, the above encoder encodes, into a value “0×FFFF”, the 16-bit information indicative of an initial status of a video buffer field included in header information of a picture layer of a video stream having been encoded in conformity to the MPEG-2 standard. Thus, when the information indicative of an initial status of a video buffer value is optionally encoded, it is not possible to calculate a correct bit storage quantity of the VBV buffer for an arbitrary picture. Therefore, with the above encoder, a bit storage quantity cannot be computed and a picture cannot be re-encoded from any bit storage quantity when editing video streams.
OBJECT AND SUMMARY OF THE INVENTION
[0011] It is therefore an object of the present invention to overcome the above-mentioned drawbacks of the prior art by providing an encoding apparatus and method, and a multiplexing apparatus and method, adapted to re-encode a part of video streams in edition of them without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
[0012] The above object can be attained by providing an encoder including, according to the present invention:
[0013] means for re-encoding a first encoded stream ending with a first picture and a second stream concatenated to the end of the first picture and starting with a second picture;
[0014] a first means for calculating, for a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means, a first bit storage quantity which should be when input of the first picture of the first encoded stream to the video buffer ends;
[0015] a second means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for starting decoding of the second picture of the second encoded stream according to the virtual system target model; and
[0016] means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means.
[0017] The above encoder further includes means for multiplexing, based on the first bit storage quantity, multiplexed streams including the second encoded stream re-encoded by the encoding controlling means.
[0018] The virtual system target decoder used in the above encoder conforms to the MPEG (Moving Picture coding Experts Group) standard.
[0019] Also the above object can be attained by providing an encoding method including, according to the present invention, steps of:
[0020] calculating, for a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams, a first bit storage quantity which should be when input of a first picture of a first encoded stream ending with the first picture to the video buffer ends;
[0021] calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for starting, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the end of the first picture and beginning with the second picture; and
[0022] re-encoding the second encoded stream based on the second bit storage quantity.
[0023] The above encoding method further includes a step of re-multiplexing, based on the first bit storage quantity, multiplexed streams including the second encoded stream re-encoded by the encoding controlling means.
[0024] The virtual system target decoder used in the above encoding method conforms to the MPEG (Moving Picture coding Experts Group) standard.
[0025] With the above encoding apparatus and method, it is possible to re-encode a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
[0026] Also the above object can be attained by providing an encoder including according to the present invention:
[0027] means for re-encoding a first encoded stream beginning with a first picture and a second stream concatenated to the beginning of the first picture and ending with a second picture;
[0028] means for calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means should have for decoding the first picture of the first encoded stream;
[0029] means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for ending decoding of the second picture of the second encoded stream according to the virtual system target model; and
[0030] means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means.
[0031] The virtual system target decoder used in the above encoder conforms to the MPEG (Moving Picture coding Experts Group) standard.
[0032] Also the above object can be attained by providing an encoding method including, according to the present invention, steps of:
[0033] calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams should have for decoding a first picture at the top of a first encoded stream;
[0034] calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer should have for ending, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the beginning of the first picture and ending with the second picture; and
[0035] re-encoding the second encoded stream based on the second bit storage quantity.
[0036] With the above encoding apparatus and method, it is possible to re-encode a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
[0037] Also the above object can be attained by providing a multiplexer including according to the present invention:
[0038] means for re-encoding a first encoded stream beginning with a first picture and a second stream concatenated to the beginning of the first picture and ending with a second picture;
[0039] means for calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means should have for decoding the first picture of the first encoded stream;
[0040] means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for decoding of the second picture of the second encoded stream according to the virtual system target model;
[0041] means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means;
[0042] a multiplexing means for generating a multiplexed stream including the second encoded stream using the second encoded stream re-encoded by the encoding means;
[0043] means for judging whether or not a third bit storage quantity the video buffer in the virtual system target decoder should have for concatenating the multiplexed stream re-multiplexed by the multiplexing means to a multiplexed stream including the first encoded stream presented after the re-multiplexed multiplexed stream from the multiplexing means, is within a predetermined range;
[0044] a multiplexing controlling means for controlling, based on the judgment result from the judging means, the time when the first picture of the multiplexed stream including the first encoded stream is to be supplied to the system target decoder model.
[0045] Also the above object can be attained by providing a multiplexing method including, according to the present invention, steps of:
[0046] calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams should have for decoding a first picture at the top of a first encoded stream;
[0047] calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for ending, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the beginning of the first picture and ending with the second picture;
[0048] re-encoding the second encoded stream based on the second bit storage quantity;
[0049] generating a multiplexed stream including the second encoded stream using the re-encoded second encoded stream;
[0050] judging whether or not a third bit storage quantity the video buffer in the virtual system target decoder should have for concatenating the re-multiplexed multiplexed stream multiplexed to a multiplexed stream including the first encoded stream presented after the multiplexed stream, is within a predetermined range;
[0051] controlling, based on the judgment result, the time when the first picture of the multiplexed stream including the first encoded stream is to be supplied to the system target decoder model.
[0052] With the above multiplexing apparatus and method, it is possible to re-encode, for re-multiplexing, a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
[0053] These objects and other objects, features and advantages of the present intention will become more apparent from the following detailed description of the preferred embodiments of the present invention when taken in conjunction with the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
[0054]
FIG. 1 is a block diagram of the moving picture recording and/or writing apparatus according to the present invention;
[0055]
FIG. 2
a
shows a video stream at the outpoint side;
[0056]
FIG. 2
b
shows a video stream at the inpoint side;
[0057]
FIG. 2
c
shows a portion of the outpoint-side video streams, re-encoded and re-multiplexed by the moving picture recording and/or reproducing apparatus in FIG. 1;
[0058]
FIG. 2
d
shows a portion of the inpoint-side video streams, re-encoded and re-multiplexed by the moving picture recording and/or reproducing apparatus;
[0059]
FIG. 2
e
shows an order in which the video streams re-encoded and re-multiplexed by the moving picture recording and/or reproducing apparatus are presented;
[0060]
FIG. 3
a
shows multiplexed streams of an outpoint-side program re-multiplexed by the moving picture recording and/or reproducing apparatus;
[0061]
FIG. 3
b
shows a bridge sequence generated by re-multiplexing;
[0062]
FIG. 4
a
shows multiplexed streams of the inpoint-side program re-multiplexed by the moving picture recording and/or reproducing apparatus;
[0063]
FIG. 4
b
shows a bridge sequence generated by re-multiplexing;
[0064]
FIG. 5 shows structures of multiplexed streams, before and after an edit point, of the outpoint-side and inpoint-side programs, respectively;
[0065]
FIG. 6 is a block diagram of a system target decoder to decode streams multiplexed by the moving picture recording and/or reproducing apparatus;
[0066]
FIG. 7 is a timing chart of operations effected by the system target decoder when it is supplied with steams multiplexed by the moving picture recording and/or reproducing apparatus;
[0067]
FIG. 8 shows a VBV model conforming to the MPEG standard;
[0068]
FIG. 9 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus for re-encoding video streams and then re-multiplexing them;
[0069]
FIG. 10 shows a relation between STC time for Clip-2 and bit storage quantity the video buffer (bit storage quantity for STD buffer) should have;
[0070]
FIG. 11 shows a relation between time and bit storage quantity the video buffer (bit storage quantity for STD buffer) should have for encoding Clip- 1;
[0071]
FIG. 12 shows a relation between time and bit storage quantity the video buffer (bit storage quantity for STD buffer) should have for encoding Clip-2;
[0072]
FIG. 13 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus for re-encoding a video stream of the outpoint-side program;
[0073]
FIG. 14 shows a relation between quantity of bits stored in the STD video buffer when the outpoint-side video stream ( . . . , B07) is supplied, and STC-1 according to SCR added to a video pack;
[0074]
FIG. 15 shows a relation between quantity of bits stored in the VBV video buffer when the inpoint-side video stream (I12, . . . ) is supplied, and STC-1 according to SCR added to a video pack;
[0075]
FIG. 16 shows a relation between quantity of bits stored in the STD video buffer when the outpoint-side video stream is supplied and then the inpoint-side video stream is supplied, and STC-1 and STC-2;
[0076]
FIG. 17 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus when re-encoding and re-multiplexing video streams of the inpoint-side program;
[0077]
FIG. 18 shows a relation between quantity of bits stored in the STD buffer when the inpoint-side video stream (Im2, Im0, . . . ) is supplied, and STC-2 according to SCR added to a video pack;
[0078]
FIG. 19 explains how to determine an allocated bit quantity so that bit storage quantity Bend2 the VBV buffer should have at a time when a picture Bn7x included in GOP(n-x) being a GOP to re-encode, becomes larger than a bit storage quantity Bj;
[0079]
FIG. 20 shows a relation between STC-2 and bit storage quantity the STD video buffer should have when a video pack including a re-multiplexed inpoint-side GOP starts being supplied (SCR_video2_start) from a time scr(In5x) and then video packs after the time scr(m2) are supplied to the STD video buffer;
[0080]
FIG. 21 shows a relation between STC-2 and quantity of bits stored in the STD video buffer when a video pack including a re-multiplexed inpoint-side GOP starts being supplied (SCR_video2_start) from the time scr(In5x) and then video packs after a time scr(Im2) are supplied to the STD video buffer;
[0081]
FIG. 22 explains how to rewrite SCR added to a video pack so that an inpoint-side video data is supplied to the video buffer with a delay of a predetermined time;
[0082]
FIGS. 23
a
to 23d show together another example of re-encoding of an outpoint-side video stream by the moving picture recording and/or reproducing apparatus, of which:
[0083]
FIG. 23
a
shows an outpoint-side video stream including an outpoint picture;
[0084]
FIG. 23
b
shows re-encoding and re-multiplexing of outpoint-side video streams by the moving picture recording and/or reproducing apparatus;
[0085]
FIG. 23
c
shows another example of re-encoding and re-multiplexing of outpoint-side video streams by the moving picture recording and/or reproducing apparatus; and
[0086]
FIG. 23
d
shows a still another example of re-encoding and re-multiplexing of outpoint-side video streams by the moving picture recording and/or reproducing apparatus;
[0087]
FIGS. 24
a
to 24d show together another example of re-encoding of an inpoint-side video stream by the moving picture recording and/or reproducing apparatus, of which:
[0088]
FIG. 24
a
shows an inpoint-side video stream including an inpoint picture;
[0089]
FIG. 24
b
shows re-encoding and re-multiplexing of inpoint-side video streams by the moving picture recording and/or reproducing apparatus;
[0090]
FIG. 24
c
shows another example of re-encoding and re-multiplexing of inpoint-side video streams by the moving picture recording and/or reproducing apparatus; and
[0091]
FIG. 24
d
shows a still another example of re-encoding and re-multiplexing of inpoint-side video streams by the moving picture recording and/or reproducing apparatus;
[0092]
FIG. 25 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus for re-encoding by the video encoder having been described above with reference to FIG. 23 and re-multiplexing by the multiplexer;
[0093]
FIG. 26 explains an example that the bit storage quantity Bend1 is judged by the video encoder to be larger than the initial bit storage quantity Bvs;
[0094]
FIG. 27 explains an example that the bit storage quantity Bend1 is judged by the video encoder to be smaller than the initial bit storage quantity Bvsd;
[0095]
FIG. 28 explains how to change the bit storage quantity of the video buffer shown in FIG. 27;
[0096]
FIG. 29 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus for re-encoding by the video encoder having been described above with reference to FIG. 24 and re-multiplexing by the multiplexer;
[0097]
FIG. 30 explains an example that the bit storage quantity Bend2 is judged by the video encoder to be larger than the initial bit storage quantity Bj;
[0098]
FIG. 31 explains an example that the bit storage quantity Bend2 is judged by the video encoder to be smaller than the initial bit storage quantity Bj;
[0099]
FIG. 32 explains how to change the bit storage quantity of the video buffer shown in FIG. 31; and
[0100]
FIG. 33 is a block diagram of a system target decoder to combine multiplexed streams multiplexed in the form of a transport stream by the moving picture recording and/or reproducing apparatus.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0101] Referring now to FIG. 1, there is illustrated in the form of a schematic block diagram a moving picture recording and/or reproducing apparatus in which the encoder or encoding method and multiplexer or multiplexing method according to the present invention are employed. The moving picture recording and/or reproducing apparatus is generally indicated with a reference 1. The moving picture recording and/or reproducing apparatus 1 edits a moving image data having been compression-encoded according to the MPEG-2 standard to generate a moving image data which can be reproduced with no seam between two video streams concatenated by a decoder, and writes the moving picture data again to an optical disc 2.
[0102] The optical disc 2 used in the moving picture recording and/or reproducing apparatus 1 has packed therein a video data and audio data encoded according to the MPEG-2 standard, and has recorded therein multiplexed streams time-division multiplexed in units of a pack. A moving picture program including an outpoint picture in any of two video streams concatenated for reproduction is called “outpoint-side program” and a moving picture program including an inpoint picture in the video stream is called “inpoint-side program”. A group of pictures (GOP) including the outpoint picture in the video stream reproduced is called “outpoint-side GOP” and a GOP including the inpoint picture in the video stream reproduced is called “inpoint-side GOP”.
[0103] As shown in FIG. 1, the moving picture recording and/or reproducing apparatus 1 includes a read head 3 to read multiplexed streams from the optical disc 2, a demodulator 4 to demodulate the multiplexed streams read by the read head 3, an error correction circuit (ECC) 5 to make an error correction of the multiplexed streams demodulated by the demodulator 4, a buffer 6 to provisionally store the multiplexed streams whose error has been corrected by the ECC circuit 5, an error correction code (ECC) appending circuit 7 to append an error correction code (ECC) to multiplexed streams generated by edition, a modulator 8 to modulate the multiplexed streams to which the ECC has been appended by the ECC appending circuit 7, and a write head 9 to write to the optical disc 2 the multiplexed streams modulated by the modulator 8.
[0104] Further, the moving picture recording and/or reproducing apparatus 1 includes a demultiplexer 11 to separate multiplexed streams stored in the buffer 6 into a video stream and audio stream, a video decoder 12 for decoding the video stream separated by the demultiplexer 11 to generate video data, a video encoder 13 for re-encoding the video data decoded by the video decoder 12 to generate video stream, and a multiplexer 14 for making a time-division multiplexing of the video and audio streams to generate multiplexed streams.
[0105] Moreover, the moving picture recording and/or reproducing apparatus 1 includes an edit information input device 15 to supply the read head 3 with edit information necessary for reproduction of information such as inpoint picture information and outpoint picture information. The edit information input device 15 generates edit information from inpoint picture information and outpoint picture information designated according to an operation input command supplied from a keyboard or the like operated by the user for example, and supplies it to the read head 3.
[0106] Also, the moving picture recording and/or reproducing apparatus 1 includes an analysis controller 16 which analyzes edit information supplied from the edit information input device 15, multiplexed streams supplied from the demultiplexer 11, etc., generates editing information necessary for allowing the decoder to make a seamless reproduction, and controls the video encoder 13 and multiplexer 14. The analysis controller 16 provides the video encoder 13 with a method allowing the video encoder 13 to re-encode the a video stream, and supplies the multiplexer 14 with editing information suggesting a method by which the multiplexer 14 is allowed to re-multiplex the video stream.
[0107] Furthermore, the moving picture recording and/or reproducing apparatus 1 includes a select switch 17 to select a video stream route along which a video stream is supplied to the multiplexer 14. Under the control of the analysis controller 16, the select switch 17 makes a selection between two routes, along which a video stream separated by the demultiplexer 11 is decoded by the video decoder 12 and re-encoded by the video encoder 13 and then supplied to the multiplexer 14, and the video stream separated by the demultiplexer 11 is supplied directly to the multiplexer 14, respectively. An audio stream separated by the demultiplexer 11 is supplied directly to the multiplexer 14 without being decoded and re-encoded.
[0108] In the moving picture recording and/or reproducing apparatus 1 constructed as in the above, the analysis controller 16 analyzes multiplexed streams recorded in the optical disc 2 to control the read head 3, video decoder 12, video encoder 13, multiplexer 14 and select switch 17, thereby producing a bridge sequence in which video streams concatenated by the decoder are reproduced with no seam between the video streams, and records the bridge sequence into the optical disc 2.
[0109] Re-encoding of a video stream in the moving picture recording and/or reproducing apparatus 1 will be described below:
[0110] In the moving picture recording and/or reproducing apparatus 1, a video stream is re-encoded by the video encoder 13 under the control of the analysis controller 16 so that for skip reproduction of a part of a moving picture program in the decoder, an outpoint-side program being a program temporally before an outpoint picture at which the skip reproduction is to start and an inpoint-side program being a program temporally after an inpoint picture at which the skip reproduction is to arrive, can be concatenated with no seam between them.
[0111] A GOP being a unit of picture groups conforming to the MPEG-2 standard includes three kinds of encoded pictures: at least an I (intra) picture being a reference picture resulted from encoding of a picture with no predictive encoding from any other picture, P (predictive) pictures being forward predictive-encoded picture resulted from encoding of a picture with a forward predictive encoding in the order of presentation, and B (bidirectional) pictures being bidirectional predictive-encoded pictures resulted from encoding of a picture within both forward predictive encoding and backward predictive encoding.
[0112] Assume for example that as shown in FIG. 2a, an outpoint-side GOP including an outpoint picture (Pout) is GOP(1) and an outpoint picture is B14 which is a B picture included in the outpoint-side GOP. The GOP(1) is contiguous to GOP(0). Also assume for example that as shown in FIG. 2b, an inpoint-side GOP including an inpoint picture (Pin) is GOP(n) and an outpoint picture is Bn4 which is a B picture included in the in point-side GOP. The GOP(n) is followed by GOP(m). Note that an I picture presented at the j-th position (namely, its temporal reference is “j”) in the i-th GOP (namely, GOP(i)) will be annotated with “Iij”, a P picture presented at the i-th position in the i-th GOP(i) be annotated with “Pij”, and a B picture presented at the j-th position in the i-th GOP(i) be annotated with “Bij”.
[0113] More specifically, the GOP(1) being an outpoint-side GOP includes pictures I12, B10, B11, P15, B13, B14, P18, B16 and B17 which are recorded in this order into the optical disc 2. Also, the GOP(n) being an inpoint-side GOP includes pictures In2, Bn0, Bn1, Pn5, Bn3, Bn4, Pn8, Bn6 and Bn7 which are recorded in this order into the optical disc 2.
[0114] The re-encoding by the video encoder 13 in the moving picture recording and/or reproducing apparatus 1 will be described below concerning the outpoint-side GOP and inpoint-side GOP as shown in FIGS. 2a and 2b.
[0115] First, The GOP(1) being an outpoint-side GOP including an outpoint picture (Pout) is decoded. Then, the GOP(1) is re-encoded so that the outpoint picture (Pout) can be decoded without the necessity of predictive reference to any encoded pictures after the outpoint picture (Pout) in the order of presentation. If the picture B14 in the GOP(l) being an outpoint-side GOP as shown in FIG. 2a is an outpoint picture (Pout), the pictures B13 and B14 having been predictive-encoded based on the picture P15 can be made without predictive reference to the picture P15, thereby generating a GOP(1-x) being a new GOP as shown in FIG. 2c.
[0116] More particularly, to generate the GOP(1-x), first the pictures I12, B10, B11, P15, B13 and B14 are decoded and rendered back to non-coded video data by the video decoder 12, and then the picture B14 is re-encoded to a picture P14x of a P picture predictive-encoded based on the picture I12. Next, the picture B13 is re-encoded to a picture B13x of a B picture predictive-encoded based on the pictures I12 and P14x. The pictures I12, B10 and B12 are copied from the GOP(l) without being re-encoded. These pictures I12, B10 and B12 may be re-encoded. As a result of the re-encoding, there is generated the GOP(1-x) composed of the pictures I12, B10, B11, P14x and B13x and SQE (sequence-end-code) as shown in FIG. 2c.
[0117] Next, The GOP(n) being an inpoint-side GOP including an inpoint picture (Pin) is decoded. Then, the GOP(n) is re-encoded so that the outpoint picture (Pin) can be decoded without the necessity of predictive reference to any encoded pictures before the outpoint picture (Pin) in the order of presentation. If the picture Bn4 in the GOP(n) being an inpoint-side GOP as shown in FIG. 2b is an inpoint picture (Pin), the picture Bn4 having been predictive-encoded based on the picture In2 can be made without predictive referencing, thereby generating a GOP(n-x) being a new GOP as shown in FIG. 2d.
[0118] More particularly, to generate the GOP(n-X), first the pictures In2, Bn0, Bn1, Pn5, Bn3, Bn4, Pn8, Bn6 and Bn7 are decoded and rendered back to non-encoded video data by the video decoder 12, and then the picture Pn5 is re-encoded to a picture In5x of an I picture. For the pictures Bn4, Pn8, Bn6 and Bn7, pictures Bn4x, Pn8x, Bn6x and Bn7x of the same types as the pictures in consideration are re-encoded. As a result of the re-encoding, there is generated the GOP(n-x) composed of SH (sequence header) the pictures In5x, Bn4x, Pn8x, Bn6x and Bn7x as shown in FIG. 2e.
[0119] In the moving picture recording and/or reproducing apparatus 1, the re-encoding of the inpoint-side and outpoint-side GOPs is effected by the video decoder 12, video encoder 13 and select switch 17 under the control of the analysis controller 16. By re-encoding the pictures ( . . . , I12, B10, B11 and B13) before the outpoint picture B14 in the order of presentation and pictures (Pn5, Pn8, Bn6, Bn7, . . . ) after the inpoint picture Bn4 in the order of presentation, the moving picture recording and/or reproducing apparatus 1 generates a moving picture which is displayed in a presented order of . . . , B10, B11, I12, B13x, P14x, Bn3x, Bn4x, In5x, Bn6x, Bn7x, Pn8x, . . . .
[0120] Next, the re-multiplexing of multiplexed streams by the multiplexer 14 provided in the moving picture recording and/or reproducing apparatus 1 will be described herebelow:
[0121] For skip reproduction of a part of a moving picture program in the decoder, the analysis controller 16 controls to have the multiplexer 14 re-multiplex multiplexed streams so that an outpoint-side program being a program temporally before an outpoint picture at which the skip reproduction is to start and an inpoint-side program being a program temporally after an inpoint picture at which the skip reproduction is to arrive can be concatenated with no seam between them.
[0122]
FIG. 3
a
shows a structure example of multiplexed streams of an outpoint-side program. In FIG. 3a, Clip-A is multiplexed streams including the outpoint-side program. For example, it is a program stream followed by a system clock reference (SCR) defined in the MPEG-2 system standard (ISO/IEC 13818-1). The Clip-A includes video streams and audio streams as time-division multiplexed in packs. In FIG. 3, each of video streams v0, v1, v2 and v3 is a video stream having the length of a GOP, and each of audio streams a0, a1, a2 and a3 is an audio stream having the length of a GOP. In the Clip-A, the streams v1 and a0 are time-division multiplexed in packs between byte positions Ba and Bjo, for example, of the Clip-A. Note that one pack has a size of 2,048 bytes for example.
[0123] As shown in FIG. 3a, in the Clip-A, the audio streams are located at byte positions a predetermined number of bytes (audio skew: AV multiplexing phase difference) off those of the video streams which will be reproduced synchronously with the audio streams. In the example shown in FIG. 3a, the audio skew is constant. It should be noted however that the audio skew may be variable in a program stream. In this example, the streams v0 and a0 are synchronous with each other. Similarly, the streams v1 and a1, v2 and a2, and v3 and a3 are synchronous with each other, respectively.
[0124] Assume here that an outpoint picture (Pout) is selected from a GOP of v3 in the Clip-A. In this case, the moving picture recording and/or reproducing apparatus 1 follows the procedure below to generate an outpoint-side bridge sequence in the following procedure. The bridge sequence is multiplexed streams acquired by re-multiplexing video streams generated by re-encoding video streams near the edit point.
[0125] First at the first step, the GOP of v3 including outpoint pictures is re-encoded by re-encoding the above video stream. In this case, a GOP of v3′ is newly generated by re-encoding the GOP of video stream v3. The time length of this new video stream v3′ is shorter than the video stream v3.
[0126] At the second step, one of video streams existing at byte points after a point Bjo for jump from the Clip-A to the outpoint-side bridge sequence and preceding the video stream v3, namely, video stream v2 in this case, is copied from the Clip-A. Also, audio streams at byte positions after the jump point Bjo and preceding an audio stream synchronous with the new video stream v3′, that is, audio streams a1 and a2 in this case, are copied from the Clip-A. Next, the audio stream synchronous with the new video stream v3′ is copied from inside the audio stream a3 to generate an audio stream a3′.
[0127] At the third step, the video streams and audio streams generated at the first and second steps are re-multiplexed. In this case, the video streams v2 and v3′, and audio streams a1, a2 and a3′ are re-multiplexed to generate a bridge sequence-A as shown in FIG. 3b and record it in the optical disc 2.
[0128] For reading the optical disc 2 having the bridge sequence-A recorded therein to concatenate the two video streams in the decoder for reproduction, the Clip-A is read down to the jump point Bjo for reproduction of the outpoint-side multiplexed streams, and then the bridge sequence-A is read.
[0129] Note that in the moving picture recording and/or reproducing apparatus 1, streams successively existing between the Clip-A down to the jump point Bjo and the bridge sequence-A have to be multiplexed to provide a program stream followed by an SCR.
[0130]
FIG. 4
a
shows a structure example of multiplexed streams of an outpoint-side program. In FIG. 4a, Clip-B is multiplexed streams including the inpoint-side program. For example, it is a program stream followed by a system clock reference (SCR) defined in the MPEG-2 system. The Clip-B includes video streams and audio streams as time-division multiplexed in packs. In FIG. 4, each of video streams v5, v6, v7 and v8 is a video stream having the length of a GOP, and each of audio streams a5, a6 and a7 is an audio stream having the length of a GOP, as in FIG. 3. In the Clip-B, the streams v8 and a7 are time-division multiplexed in packs between byte positions Bji and Bb, for example, of the Clip-B. As shown in FIG. 4a, in the Clip-B, the audio streams are located at byte positions a predetermined number of bytes (audio) off those of the video streams which will be reproduced synchronously with the audio streams. Also in the example shown in FIG. 4a, the audio skew is constant. It should be noted however that the audio skew may be variable in a program stream. In this example, the streams v5 and a5 are synchronous with each other. Similarly, the streams v6 and a6, v7 and a7, and v8 and a8 are synchronous with each other, respectively.
[0131] Assume here that an inpoint picture (Pin) is selected from a GOP of v5 in the Clip-B. In this case, the moving picture recording and/or reproducing apparatus 1 follows the procedure below to generate an inpoint-side bridge sequence in the following procedure.
[0132] First at the first step, the GOP of v5 including inpoint pictures is re-encoded by re-encoding the above video stream. In this case, a GOP of v5′ is newly generated by re-encoding the GOP of video stream v5. The time length of this new video stream v5′ is shorter than the video stream v5.
[0133] At the second step, video streams existing after the video stream v5 and at byte points preceding a point Bji for jump from the inpoint-side bridge sequence to the Clip-B, namely, video streams v6 and v7 in this case, are copied from the Clip-B. Also, a one of audio streams existing after an audio stream synchronous with the new video stream v5′ and at byte positions before the jump point Bji, that is, an audio stream a6 in this case, is copied from the Clip-B. Next, the audio stream synchronous with the new video stream v5′ is copied from inside the audio stream a5 to generate an audio stream a5′.
[0134] At the third step, the video streams and audio streams generated at the first and second steps are re-multiplexed. In this case, the video streams v5′, v6 and v7, and audio stream a5′ and a6 are re-multiplexed to generate a bridge sequence-B as shown in FIG. 4b and record it in the optical disc 2.
[0135] For reading the optical disc 2 having the bridge sequence-B recorded therein to concatenate the two video streams in the decoder for reproduction, the bridge sequence-B is read for reproduction of the inpoint-side program, and then Clip-B is read from the jump point Bji.
[0136] Note that in the moving picture recording and/or reproducing apparatus 1, streams successively existing between the bridge sequence-B and Clip-B after the jump point Bji have to be multiplexed to provide a program stream followed by an SCR.
[0137] In the moving picture recording and/or reproducing apparatus 1, the above-mentioned re-multiplexing permits to generate the bridge sequence-A as shown in FIG. 3b and bridge sequence-B as shown in FIG. 4b.
[0138]
FIG. 5 shows the structure of multiplexed streams presented before and after the edit point, in which it is assumed that multiplexed streams lasting from the Clip-A before the jump point Bjo to the bridge sequence-A are Clip-1 and a multiplexed stream lasting from the bridge sequence-B to the Clip-B after the jump point Bji are Clip-2. In the decoder, when the multiplexed stream lasting from Clip-1 to Clip-2 has successively been decoded, the video and audio streams have to be reproduced with no seam between them. In the moving picture recording and/or reproducing apparatus 1, for reproduction of the video and audio streams with no seam between them, the audio streams in Clip-1 and Clip-2 should be re-encoded and re-multiplexed with the following limits imparted to them:
[0139] In the moving picture recording and/or reproducing apparatus 1, the audio streams in Clip-1 and Clip-2 are limited so that no gap between times at which an audio stream is presented will exist at the boundary between the trailing end of Clip-1 and beginning end of Clip-2. More particularly, the audio streams of Clip-1 are re-multiplexed to include audio samples presented at a time when video streams of Clip-1 stops being presented, while the audio streams of Clip-2 are re-multiplexed to include audio samples presentation at a time when video streams of Clip-2 start being presented. Therefore, at the boundary between the trailing end of Clip-1 and beginning end of Clip-2, time lengths of presentation shorter than a time for less than two audio frames will possibly overlap each other. Note that in case of audio streams of Clip-1 in the MPEG-1 standard, one audio frame is an audio stream having a time length of presentation of 24 msec.
[0140] In FIG. 5, VILBI, AILBI, V2FBI and A2FBI in FIG. 5 are as follows:
[0141] V1LBI Last byte position of last pack in video-1 in Clip-1
[0142] A1LBI Last byte position of last pack in audio-1 in Clip-1
[0143] V2FBI First byte position of first pack in video-1 in Clip-2
[0144] A2FBI First byte position of first pack in audio-2 in Clip-2
[0145] These byte positions V1LBI and A1BLI, and V2FBI and A2FBI are in the following relations, respectively:
V1LBI<A1LBI
V2FBI<A2FBI
[0146] Other than the above relations are possible in the MPEG standard, but they rarely exist in practice.
[0147]
FIG. 6 shows the construction of a system target decoder being a virtual decoder model intended to reproduce multiplexed streams Clip-1 and Clip-2 each including packs of audio streams and video streams re-encoded and re-multiplexed by the moving picture recording and/or reproducing apparatus 1 and recorded in the optical disc 2. The system target decoder is generally indicated with a reference 20.
[0148] Each of the multiplexed streams include a video pack having appended thereto as additional information SCR (system clock reference) indicative of a n output timing to the system target decoder 20, a decoding time stamp (DTS) indicative of a decoding timing and a presentation time stamp (PTS) indicative of an output timing of decoded data, and an audio pack having SCR, DTS and PTS appended thereto as additional information as in the video pack. The decoding timing and output timing are controlled with reference to these additional information.
[0149] As shown in FIG. 6, the system target decoder 20 includes a demultiplexer 21 to receive multiplexed streams Clip-1 and Clip-2 read from the optical disc 2 and separate the multiplexed streams into a video stream and audio stream, a video buffer 22 which provisionally stores the video stream separated by the demultiplexer 21, an audio buffer 23 which provisionally stores the audio stream separated by the demultiplexer 21, a video decoder 24 to extract, for decoding, the video stream stored in the video buffer 22, a re-order buffer 25 which provisionally stores decoded video data, an audio decoder 26 which extracts, for decoding, the audio stream stored in the audio buffer 23, and an output switch 27 which selects, for delivery as output, the video data decoded by the video decoder 24 or video data stored in the re-order buffer 25.
[0150] Further the system target decoder 20 includes a timing controller 28 to provide a system time clock (STC) used to control a timing of the selection between the video stream and audio stream by the demultiplexer 21, decoding timing of the video decoder 24, decoding and output timing of the audio decoder 26, and an output timing of the output switch 27.
[0151] Also the system target decoder 20 is provided with first to fourth STC switches SW1 to SW4 to make a selection between system time clocks STC-1 and STC-2 provided from the timing controller 28.
[0152] The demultiplexer 21 is supplied with packets forming together each multiplexed stream according to SCR appended to the multiplexed stream. Based on a STC supplied from the timing controller 28, the demultiplexer 21 separates the multiplexed stream into a video stream and audio stream. Ans, the demultiplexer 21 provides the video and audio streams to the video buffer 22 and audio buffer 23 at a predetermined output rate (program_mux_rate).
[0153] The video decoder 24 is provided to extract, for decoding, data of predetermined data from the video buffer 22 when DTS appended to the video stream coincides with STC supplied from the timing controller 28. Then, when PTS coincides with DTS, the video decoder 24 delivers the decoded data to outside via the output switch 27, or stores it once in the re-order buffer 25 and then delivers it to outside via the output switch 27.
[0154] The audio decoder 26 extracts, for decoding, the audio stream from the audio buffer 23 when DTS appended to the audio stream coincides with STC supplied from the timing controller 28. And the audio decoder 26 provides to the STC switch SW3 the audio data having been decoded when PTS and STC coincide with each other.
[0155] Note that the audio buffer 23 provided upstream of the audio decoder 26 should have a following size in view of the buffer size prescribed in the MPEG-2 CSPS=1:
additional-buffer-size=(program_mux-rate-Ra)*Ra/program-mux-rate
[0156] where “Ra” is a maximum bit rate of the audio stream and “program-mux-rate” is either a maximum bit rate of the program stream Clip-1 or Clip-2 whichever is larger. For example, if program-mux-rate=10 Mbps and Ra=256 kbps, the additional-buffer-size of the audio buffer 23 is 0.249 Mbits.
[0157] The output switch 27 provides the decoded video data when PTS appended to the video pack coincides with STC supplied from the timing controller 28. Note that the output switch 27 provides as output the video data stored in the re-order buffer 25 as necessary.
[0158] When selecting, after the outpoint-side program, the inpoint-side program for concatenation of two video streams for reproduction, the timing controller 28 generates two STCs: one synchronous with SCR of the outpoint-side program and the other synchronous with SCR of the inpoint-side program.
[0159] The timing controller 28 includes an STC generator 28a to generate an STC and a subtractor 28b to subtract a predetermined offset value (STC_delta) from an STC generated by the STC generator 28a. Thus, the timing controller 28 generates two STCs. One of the STCs is an STC provided directly from the STC generator 28a and from which no offset value has been subtracted (this is synchronous with SCR of the outpoint-side program; will be referred to as “STC-1” hereinafter), and the other is a one derived from subtraction of the offset value (STC_delta) from an STC provided directly from the STC generator 28a (this is synchronous with SCR of the inpoint-side program; will be referred to as “STC-2” hereinafter).
[0160] The offset value (STC_delta) indicates an offset between the time bases of the multiplexed streams Clip-1 and Clip-2. Namely, the offset value is a difference between the time of Clip-1 on the time base when the video stream of Clip-1 disappears and the time of Clip-2 on the time base when the video stream of Clip-2 starts being presented.
[0161] On the assumption that PTS of an outpoint picture Pout on the time base of Clip-1 is PTS-Pout, presentation period of the outpoint picture Pout is Tpp and PTS of an inpoint picture Pin on the time base of Clip-2 is PTS-Pin, for example, the offset value “STC_delta” is given by the following expression (1):
PTS
-Pout-end=PTS-Pout+Tpp
i STC-delta=PTS-Pout-end−PTS-Pin (1)
[0162] Any of the two STCs (STC-1 and STC-2) provided from the timing controller 28 is selected by the first to forth STC switches SW1 to SW4, and supplied to the demultiplexer 21, video decoder 24, audio decoder 26 and output switch 27. The first STC switch SW1 will be supplied at a terminal A thereof with STC-1 and at a terminal B thereof with STC-2. It selects one of these terminals A and B and supplies STC supplied at the selected terminal to the demultiplexer 21. The second STC switch SW2 will be supplied at a terminal A thereof with STC-1 and at a terminal B thereof with STC-2. It selects one of these terminals A and B and supplies STC supplied at the selected terminal to the video decoder 24. The third STC switch SW3 will be supplied at a terminal A thereof with STC-1 and at a terminal B thereof with STC-2. It selects one of these terminals A and B and supplies STC supplied at the selected terminal to the audio decoder 26. The fourth STC switch SW4 will be supplied at a terminal A thereof with STC-1 and at a terminal B thereof with STC-2. It selects one of these terminals A and B and supplies STC supplied at the selected terminal to the output switch 27.
[0163] The system target decoder 20 constructed as in the above functions as will be described herebelow:
[0164]
FIG. 7 is a timing chart of operations effected by the system target decoder 20 when it is supplied with two multiplexed steams Clip-1 and Clip-2 contiguous to each other.
[0165] First, SCR appended to the first pack in Clip-1 is set as STC in the STC generator 28a. All the first to fourth STC switches SW1 to SW4 are connected to the terminals A, respectively, and thus STC-1 (STC synchronous with SCR of Clip-1) is supplied to the demultiplexer 21, video decoder 24, audio decoder 26 and output switch 27. Namely, all the functions work based on SCR appended to Clip-1.
[0166] Before a time T1 is reached, input to the demultiplexer 21 is made at a time when SCR appended to each pack in Clip-1 coincides with STC-1 which has not yet added thereto an offset value supplied from the terminal A of the first STC switch SW1. Next, at the time T1, the entry of the last video pack of Clip-1 to the demultiplexer 21 ends. For a time from the time T1 to a time T2, the demultiplexer 21 is supplied with each pack of Clip-1 at a maximum bit rate “program_mux_rate1” of Clip-1 regardless of SCR appended to each pack. The maximum bit rate “program_mux_rate1” may be a maximum transfer rate at which data is to be read from the optical disc 2 for example.
[0167] On the assumption that a data amount from a pack next to the last video pack in Clip-1 to the last pack in Clip-1 is “N1”, the time “ΔT1” from the time T1 to T2 is given by the following expression (2):
ΔT1=T2−T1=N1/program-mux-rate1 (2)
[0168] At the time T2, input of the last pack (audio pack) of Clip-1 to the demultiplexer 21 ends. At this time T2, the first STC switch SW1 is shifted to the terminal B and thus STC-2 (STC synchronous with SCR of Clip-2) is supplied to the demultiplexer 21. Therefore, the demultiplexer 21 starts functioning based on SCR appended to Clip-2.
[0169] For a time period between T2 and T3, the demultiplexer 21 is supplied with packs including from the first pack in Clip-2 to a pack before the first video pack in Clip-2 at the maximum bit rate program_mux_rate2 of Clip-2 regardless of SCR of each pack when the first packet in Clip-2 is not a video pack. The maximum bit rate program_mux_rate2 may be a maximum transfer rate for reading data from the optical disc 2, for example.
[0170] Assuming that the data amount from the first pack in Clip-2 to a pack before the first video pack in Clip-2 is “N2”, the time “ΔT2” from the time T2 to a time T3 is given by the following expression (3):
ΔT2=T3−T2=N2/program-mux-rate2 (3)
[0171] Note that since the first pack in an MPEG-2 program stream is usually a video pack, ΔT2=0.
[0172] Further at the time T3, the entry of the first video pack in Clip-2 to the demultiplexer 21 starts. Subsequently, input to the demultiplexer 21 is made at a time when SCR of each pack in Clip-2 coincides with STC-1 which has added thereto an offset value supplied from the terminal B of the first STC switch SW1. At this time, SCR of the first video pack in Clip-2 should meet the requirement given by the following expression (4):
SCR
-video2-start>SCR-video1-end−STC-delta+ΔT1+ΔT2 (4)
SCR
-video1-end=SCR-last-video1+pack_length/program_mux_rate1
[0173] where SCR-video2-start is SCR of the first video pack in Clip-2, SCR-video1-end is a time on the time base of Clip-1 when input the last video pack in Clip-1 to the demultiplexer 21 ends. This value can be calculated as follows from system-clock-reference(SCR-last-video 1), program-mux-rate1 and pack-length of the last video pack in Clip-1. The pack-length is 2,048 bytes for example.
[0174] Next at a time T4, the second STC switch SW2 is shifted from the terminal A thereof to the terminal B, and STC to which the video decoder 24 makes reference is changed from STC-1 to STC-2. Since STC is changed for reference to DTS appended to each picture in the video stream, the video decoder 24 starts decoding the video stream in Clip-2.
[0175] At a time T5, the third STC switch SW3 is shifted from the terminal A thereof to the terminal B, and STC to which the audio decoder 26 make reference is changed from STC-1 to STC-2. Since STC is changed for reference to PTS appended to each picture in the audio stream, the audio decoder 26 starts output of audio streams in Clip-2. Note that when the audio data at the trailing end of Clip-1 and audio data at the beginning end of Clip-2 overlap each other, it is necessary to select which sample of these audio data should be presented.
[0176] Next at a time T6, the fourth STC switch SW4 is shifted from the terminal A thereof to the terminal B, and STC to which the output switch 27 makes reference is changed from STC-1 to STC-2. Since STC is changed for reference to PTS appended to each picture in the video stream, the output switch 27 starts output of the video stream in Clip-2.
[0177] If all the first to fourth STC switches SWI to SW4 are shifted to their respective terminals B, respectively, at this time T6, the value of STC generated by the STC generator 28a is reset to [STC−STC-delta] and at the same time all the first to fourth STC switches SW1 to SW4 are shifted to their respective terminals A. Thus, the status before the time T1 is restored.
[0178] The system target decoder 20 defining the above-mentioned virtual decoder model, defines, by the moving picture recording and/or reproducing apparatus 1, the limitation imposed on the encoding and multiplexing of video streams to limit the capacity of the video buffer 22 in order to prevent underflowing and overflowing of the video buffer 22 when encoded video stream is supplied to the video decoder 22.
[0179] For encoding and multiplexing video streams by the moving picture recording and/or reproducing apparatus 1, the video streams are encoded to comply with the VBV (video buffering verifier) model 30 conforming to the MPEG standard, shown in FIG. 8, and then multiplexed to prevent overflowing of the video buffer 22 of the system target decoder in FIG. 6.
[0180] The VBV model 30 includes a VBV buffer 31 which is supplied with video streams and a virtual video decoder 32 which is supplied with the video streams at a predetermined output timing from the VBV buffer 31 to decode the video streams. Namely, the VBV model 30 is designed to make an ideal decoding and provide decoded pictures.
[0181] The moving picture recording and/or reproducing apparatus 1 encodes a 16-bit field “information indicative of an initial status of a video buffer” included in each picture and indicative of the initial status of the VBV buffer 31 at the time of random access. The information indicative of an initial status of a video buffer value represents a bit storage quantity the VBV buffer 31 should have for decoding the picture. When decoding a picture, the virtual video decoder 32 of the VBV model 30 reads information indicative of an initial status of a video buffer appended to that picture, and decodes the picture when the bit storage quantity of the VBV buffer 31 has reached the bit storage quantity represented by information indicative of an initial status of a video buffer.
[0182]
FIG. 9 is a flow chart of operations effected by the moving picture recording and/or reproducing apparatus 1 for re-encoding video streams and then re-multiplexing them according to the limitations on the definition of a virtual decoder model such as the aforementioned system target decoder 20 to re-encode and re-multiplex the video streams. The re-encoding and re-multiplexing will be described below:
[0183] As shown in FIG. 9, at step S1, the moving picture recording and/or reproducing apparatus 1 determines various parameters for coping with the limitations defined by the system target decoder 20 in re-encoding by the video encoder 13 and re-multiplexing by the multiplexer 14.
[0184] More particularly, the moving picture recording and/or reproducing apparatus 1 determines a bit rate “Rv1” of video streams in an outpoint-side program to re-encode, bit rate “Rv2” of video streams in an inpoint-side program to re-encode, bit storage quantity Bvsd the VBV buffer 31 should have for decoding the first picture in the inpoint-side program to re-encode, and a multiplexing phase difference time Tas for multiplexing video streams and audio streams in the re-encoded outpoint-side program. The variety of parameters are set as will further be described later.
[0185] Next at step S2, the moving picture recording and/or reproducing apparatus 1 re-encodes video streams in the outpoint-side program by means of the video encoder 13, and makes time-division multiplexing of the re-encoded video streams and audio streams in packs by means of the multiplexer 14. The outpoint-side program is re-encoded and re-multiplexed as will further be described later.
[0186] At step S3, the moving picture recording and/or reproducing apparatus 1 ends its operations by re-encoding video streams in the inpoint-side program by means of the video encoder 13, and making time-division multiplexing of the re-encoded video streams and audio streams in packs by means of the multiplexer 14. The inpoint-side program is re-encoded and re-multiplexed as will further be described later.
[0187] Next, the variety of parameters used for re-encoding at step S1 shown in FIG. 9 will be described herebelow:
[0188] In the moving picture recording and/or reproducing apparatus 1, when data are re-encoded by the video encoder 13 and when a video stream in the multiplexed streams including Clip-1 and Clip-2 are edited, the bit rate “Rv1”, bit rate “Rv2”, bit storage quantity Bvsd and multiplexing phase difference time Tas are determined to meet the following expression (5):
(Tvs1−Tms1)+(Tvs2−Tms2)<ΔT1 (5)
[0189] where Tvs1=Bvsd/Rv1, Tms1=Bvsd/(Rm1−Ra1), Tvs2=Bvsd/Rv2, Tms2=Bvsd/(Rm2−Ra2) and ΔT1=Tas*Ra1/Rm1.
[0190] Rm1 is a bit rate “program_mux-rate” of the multiplexed stream of Clip-1, Ra1 is a bit rate of the audio stream in Clip-1. Rm2 is a bit rate “program-mux-rate”, Ra2 is a bit rate of audio stream in Clip-2. Rm1 and Rm2 are given by the following expressions (6) and (7), respectively:
Rm
1
=Ra1+Rv1+α (6)
Rm
2
=Ra2+Rv2+β (7)
[0191] where α>0 and β>0.
[0192] Further, Bvsd is a bit storage quantity of the VBV buffer 31. It is a bit storage quantity the VBV buffer 31 should have for decoding the first I picture in GOP included in an inpoint picture of Clip-2 for example.
[0193] An example that Bvsd is a bit storage quantity of the VBV buffer 31 for decoding the picture In2 in GOP(n) shown in FIG. 2b will be described herebelow with reference to FIG. 10 showing a relation between STC time (STC-2) for Clip-2 and bit storage quantity of the video buffer 22 (bit storage quantity for STD buffer) for supplying the system target decoder 20 with video and audio streams. In FIG. 10, the STD buffer indicates a bit storage quantity of the video buffer 22 for supplying the system target decoder 20 with Clip-1 and Clip-2 of multiplexed video stream and audio streams. Therefore, since the time zone in which the bit storage quantity is indicated with a line whose gradient is zero (horizontal) is a one for which audio streams are supplied from the demultiplexer 21 for example to the audio buffer 23, the bit storage quantity of the STD buffer indicates that the data input to the video buffer 22 is stopping. FIG. 15 shows a bit storage quantity of the VBV buffer 31 for supplying only video streams to the VBV buffer 31. In FIG. 10, the gradient of the rightward ascending line indicates a bit rate of the multiplexed streams. In FIG. 15, the rightward ascending line indicates a bit rate of video streams.
[0194] In FIG. 10, scr(In2) is a time at which a video pack including a top video pack of picture In2 is supplied to the system target decoder 20, and also a time presented at SCR included in the header of the video pack. The pack including a top data of the picture In2 is supplied to the system target decoder 20 at a time when STC and scr(In2) coincide with each other. When the system target decoder 20 is supplied with the video stream of the video pack, the bit storage quantity of the video buffer 22 increases at a bit rate “Rm2”. In FIG. 10, dts(In2) is a time when the picture In2 is decoded, and also a time indicated with DTS appended to a video pack including the picture In2. At the time dts(In2), the video data of the picture In2 is drawn and the bit storage quantity decreases.
[0195] As shown in FIG. 10, the bit storage quantity of the video buffer 22 in the system target decoder 20 at the time dts(In2) is a bit storage quantity Bvsd in the VBV buffer 31 for decoding the first picture of the inpoint-side video stream to re-encode.
[0196] Furthermore, ΔT1 is a time from a time (T1) when input of the last video pack of Clip-1 to the demultiplexer 21 ends until a time (T2) when input of the last pack (audio pack) of Clip-1 to the demultiplexer 21 ends, and it is given by the following expression (8):
ΔT1=T2−T1=N1/program_mux-rate (8)
[0197] where N1 is a data amount counted from a pack next to the last video pack of Clip-1 to the last pack of Clip-1.
[0198] The moving picture recoding and/or reproducing apparatus 1 re-encodes and re-multiplexes so that the bit rates “Rv1” and “Rv2”, bit storage quantity “Bvsd” and multiplexing phase difference time Tas defined as in the above will meet the requirements defined by the aforementioned expression (4).
[0199]
FIG. 11 shows a relation between time and quantity of bits stored in the VBV buffer 31 or STD buffer (video buffer 22) when encoding Clip-1. As shown in FIG. 11, Tms1 is a time taken of the bit storage quantity Bvsd to be reached when the video buffer 22 is supplied with video streams at a bit rate Rm1-Ra1, and Tvs1 is a time required of the bit storage quantity Bvsd to be reached when the VBV buffer 31 is supplied with video streams at a bit rate Rv1. When video streams of Clip-1 are supplied to the video buffer 22, the larger the term α in the expression (6), the longer the time X (=Tvs1−Tms1) in FIG. 11 is, so that the time (SCR-video1-end) at which input of video data in Clip-1 to the video buffer 22 ends can be reached more early.
[0200] Further, FIG. 12 shows a relation between time and quantity of bits stored in the VBV buffer 31 or STD buffer (video buffer 22) when encoding Clip-2. In FIG. 12, Tms2 is a time required for the bit storage quantity to be reached when video streams are supplied to the video buffer 22 at the bit rate “Rm2-Ra2”, and Tbs2 is a time required for the bit storage quantity Bvsd to be reached when video streams are supplied to the VBV buffer 31 at the bit rate “Rv2”. When video streams of Clip-2 are supplied to the video buffer 22, the larger the term β in the expression (7), the longer the time Y (=Tvs2−Tms2) in FIG. 11 is, so that the time (SCR_video2_start) at which input of video data in Clip-2 to the video buffer 22 ends can be reached more slowly.
[0201] Next, the re-encoding and re-multiplexing of video streams in the outpoint-side program, effected at step S2 by the moving picture reproducing and/or reproducing apparatus 1, will be described herebelow with reference to FIG. 13:
[0202] As in FIG. 13, first at step S11, the video encoder 13 determines the type of each picture in the video data to re-encode. That is, as shown in FIGS. 2a and 2c, when a picture B14 is an outpoint picture Pout, the video encoder 13 changes the picture type for re-encoding so that the picture B14 predictive-encoded based on a picture B18 can be made with no predictive reference.
[0203] Next at step S12, the video encoder 13 calculates a bit storage quantity Ba when input to the video buffer 22 (STD buffer) of the system target decoder 20 of the last picture of a non-re-encoded outpoint-side multiplexed video stream ends.
[0204] More specifically, the last picture in the non-re-encoded video stream is a data just before re-encoded, namely, B07 in GOP(0) shown in FIG. 2c.
[0205]
FIG. 14 shows a relation between quantity of bits stored in the video buffer 22 (bit storage quantity of the STD video buffer) for supplying the outpoint-side video streams ( . . . , B07) shown in FIG. 2c, and STC-1 according to SCR added to a video pack and generated by the timing generator 28. FIG. 14 shows a bit storage quantity when a video pack including pictures B04, B08, B06 and B07 is supplied to the video buffer 22.
[0206] In FIG. 14, scr(B04) is a time when a video pack including the picture B04 is first supplied to the system target decoder 20. When STC-1 supplied from the timing controller 28 coincides with scr(B04), input of the video pack to the system target decoder 20 is started according to SCR, and the video pack is decoded by the video decoder 24 according to DTS appended to each picture. That is, the video decoder 24 decodes the picture B04 when a time dts(B04) is reached, the picture B08 when a time dts(P08) is reached, the picture B06 when a time dtS(P06) is reached, and the picture B07 when a time dts(B07) is reached.
[0207] The bit storage quantity Ba of the video buffer 22 (STD buffer) which should be at a time Ta when the input of the last picture B07 included in GOP(0) to the system target decoder 20 ends, is calculated.
[0208] Also, access unit sizes a(P08), a(P06) and a(P07) of the pictures P08, B06 and B07, respectively, to decode after the time Ta are examined.
[0209] In the example shown in FIG. 14, when STC-1 coincides with scr(B04), the calculation of the bit storage quantity Ba is started. However, the calculation of the bit storage quantity Ba may be started before the time scr(B04). In effect, it suffices that at least one DTS exists between the start time of the calculation of the bit storage quantity Ba and time Ta. The calculation of the bit storage quantity may be started beginning with an picture I02 for example in FIG. 2c.
[0210] Next at step S13 in FIG. 13, the vide encoder 13 determines, based on the bit storage quantity Ba having been calculated at step S12, a bit storage quantity Bos of the VBV buffer 31 for decoding the first picture in the video stream to re-encode.
[0211] More specifically, the first picture in the video stream to re-encode is a picture I12 of GOP(1-x) in FIG. 2c.
[0212]
FIG. 15 shows a relation between quantity of bits stored in the VBV video buffer 31 when the inpoint-side video stream (I12, . . . ) shown in FIG. 2c are supplied, and SCR-1 generated by the timing controller 28 according to SCR added to a video pack. FIG. 15 shows stored bit quantities in the VBV buffer 31 when this buffer is supplied with pictures B08, B06, B07, I12, B10, B11, P14x and P13x.
[0213] The video encoder 13 determines an initial bit storage quantity Bos of the VBV buffer 31 for decoding the first picture I12 in the video stream to re-encode. At this time, the video encoder 13 first sets the bit storage quantity of the VBV buffer 31, which should be at the time dts(P08) to the value Ba. When the bit storage quantity Ba is larger than 1.75 Mbits, the bit storage quantity Ba is set to 1.75 Mbits.
[0214] Further, based on the bit storage quantity Ba having been set as in the above, access unit sizes a(P08), a(B06) and a(B07) of the pictures P08, B06 and B07, examined at step S13 and the bit rate Rv1, the video encoder 13 determines the bit storage quantity Bos of the VBV buffer 31, which should be at the time dts(I12) when decoding of one (B07) of the pictures P08, B06 and B07 by the video decoder 24 ends.
[0215] Next at step S14, the video encoder 13 determines a bit storage quantity Bend1 which should be for decoding of the last picture (P13x) of the video stream to re-encode ends. Then, the video encoder 13 determines an allocated bit amount for a video stream to re-encode so that the bit storage quantity Bend1 of the VBV buffer 31 will be larger than the bit storage quantity Bvsd of the VBV buffer 31 for decoding the picture in the inpoint-side video stream.
[0216] At step S15, based on the allocated bit amount determined at step S14 for the video stream, the video encoder 13 re-encodes the outpoint-side video stream, and the multiplexer 14 re-multiplexes the re-encoded video stream.
[0217] For the re-multiplexing, the multiplexer 14 will multiplex the video streams having been re-encoded for a time period from the time Ta until a time SCR_video1_end at which input of the last video pack on the outpoint side to the demultiplexer 21 ends, as shown in FIG. 16. Thereby, the multiplexer 14 multiplexes Clip-1 consisting of Clip-A and bridge sequence-A.
[0218]
FIG. 16 shows a relation between bit storage quantity of the STD video buffer 22 for supplying the outpoint-side video stream and then the inpoint-side video stream is supplied, and STC-1 and STC-2. In FIG. 16, the vertical axis indicates the bit storage quantity of the video buffer 22 (STD buffer), BS is 232 kbytes in the MPEG-2 MP@ML for example, and the horizontal axis indicates STC-1 and STC-2 generated by the timing controller 28. Also in FIG. 16, the dotted line indicates a bit storage quantity depicting a trajectory along which STC-1 and STC-2 are successively supplied to the video buffer 22.
[0219] Next, re-encoding and re-multiplexing of the inpoint-side program, effected by the moving picture recording and/or reproducing apparatus 1 at step S3 will be described herebelow with reference to FIG. 17. FIG. 17 is a flow chart of operations of the moving picture recording and/or reproducing apparatus 1 in re-encoding and re-multiplexing video streams of the inpoint-side program.
[0220] As shown in FIG. 17, first at step S21, the video encoder 13 determines the type of each picture in the video data to re-encoded.
[0221] Namely, as having previously been described with reference to FIGS. 2b and 2d, the video encoder 13 changes the picture type to I picture so that when the picture Bn4 for example is an inpoint picture (Pin), a picture Pn5 having been predictive-encoded based on a picture In2 can be made without predictive reference.
[0222] Next at step S22, the video encoder 13 calculates an initial bit storage quantity Bj′ which should be when the first picture of a video stream being an inpoint-side multiplexed stream and having not yet been re-encoded is supplied to the video buffer 22 (STD buffer) of the system target decoder 20.
[0223] More particularly, the first picture in the video stream not yet re-encoded is a data immediately after GOP(n) to re-encode, that is, a picture Im2 of GOP(m) shown in FIG. 2d.
[0224]
FIG. 18 shows a relation between a bit storage quantity of the video buffer 22 (bit storage quantity of the STD buffer) which should be when the inpoint-side video streams (Im2, Im0, . . . ) shown in FIG. 2d are supplied and STC-2 according to SCR added to a video pack and generated by the timing controller 28. FIG. 18 shows a bit storage quantity of the video buffer when supplied with the video pack consisting of pictures Im2, Bm0 and Bm1.
[0225] In FIG. 18, scr(Im2) is a time when a video pack including the picture Im2 is first supplied to the system target decoder 20. Input of the video pack to the system target decoder 20 according to SCR starts when STC-2 from the timing controller 28 coincides with scr(Im2), and the video pack is decoded by the video decoder 24 according to DTS appended to each picture. Namely, the video decoder 24 decodes the picture Im2 when the time dts(Im2) is reached, the picture Bm0 when the time dts(Bm0) is reached, and the picture Bm1 when the time dts(Bm1) is reached. The video encoder 13 calculates an initial bit storage quantity Bj′ of the video buffer 22 (STD buffer) which should be at the time dts(Im2).
[0226] Next at step S23, the video encoder 13 determines, based on the initial bit storage quantity Bj′ calculated at step S22, a bit storage quantity Bj of the VBV buffer 31 for decoding the first picture in the video stream to re-encode.
[0227] More specifically, the first picture in the video stream not re-encoded is a picture Im2 in GOP(m) in FIG. 2d. In this embodiment, the initial bit storage quantity Bj of the VBV buffer 31 is taken as the bit storage quantity Bj′ determined at step S22. When the bit storage quantity Bj′ is larger than 1.75 Mbits, the bit storage quantity Bj is 1.75 Mbits.
[0228] Next at step S24, the video encoder 13 determines an allocated bit amount of a video data to re-encode so that the bit storage quantity of the VBV buffer 31 after the last picture to re-encode is decoded is larger than the initial bit storage quantity Bj.
[0229] More specifically, as shown in FIG. 19, the video encoder 13 will determine an allocated bit amount so that the bit storage quantity Bend2 which should be at a time when decoding of a picture Bn7x included in GOP(n-x) being a GOP to re-encode shown in FIG. 2d ends is larger than the bit storage quantity Bj.
[0230] At step S25, the video encoder 13 re-encodes, based on the allocated bit amount determined at step S24, GOP(n-x) being a GOP to re-encode, of the inpoint-side video stream.
[0231] Next at step S26, the video stream re-encoded at step S25 is re-multiplexed. At this time, the multiplexer 14 starts re-multiplexing the re-encoded Clip-2 video stream at the a time SCR_video2_start as shown in FIG. 16. At this time, the multiplexer 14 determines the time SCR_video2_start according to STC-2 generated by the timing controller 28 of the system target decoder 20 and re-multiplexes so that the video buffer 22 will not overflow.
[0232] At step S27, the moving picture recording and/or reproducing apparatus 1 judges whether or not the video buffer 22 (STD buffer) of the system target decoder 20 when the apparatus 1 shifts from the video stream re-multiplexed at step S26 to a video stream not yet re-multiplexed.
[0233] Namely, the multiplexer 14 will judge whether or not the video buffer 22 (STD buffer) will overflow when the re-multiplexed GOP(n-x) is concatenated to GOP(m) presented after the re-multiplexed GOP(n-x).
[0234] More particularly, as shown in FIG. 20 for example, if the bit storage quantity depicts a trajectory below the bit storage quantity BS as indicated with a dotted line when a video pack including the inpoint-side GOP re-multiplexed at the time scr(In5x) starts being supplied as input (SCR_video2_start) and video streams following the video stream re-multiplexed at the time scr(Im2) start being successively supplied as input, the picture Im2 starts being decoded at the time dts(Im2) with the video buffer 22 (STD buffer) not overflowing.
[0235] On the other hand, a shown in FIG. 21, if the bit storage quantity depicts a trajectory below the bit storage quantity BS as indicated with a dotted line in FIG. 21 when a video pack including inpoint-side GOP re-multiplexed at the time scr(In5x) starts being supplied as input (SCR_video2_start) and video streams following the video stream re-multiplexed at the time scr(Im2) start being successively supplied to the video buffer 22, the video buffer 22 (STD buffer) will overflow. That is, as having been described in the above with reference to FIG. 20, if the moving picture recording and/or reproducing apparatus 1 decides, when following the re-multiplexed video stream, video streams start being supplied as input at the time scr(Im2), that the video buffer 22 (STD buffer) will not overflow, the multiplexer 14 will end the operations. As having been described in the above with reference to FIG. 21, if the moving picture recording and/or reproducing apparatus 1 decides, when following the re-multiplexed video stream, video streams start being supplied as input at the time scr(Im2), that the video buffer 22 (STD buffer) will overflow, the operation goes to step S28.
[0236] At step S28, the multiplexer 14 rewrites SCR appended to a video pack in order to delay the time at which a video pack is supplied as input before the time when the first picture of the video stream presented following the re-multiplexed video stream is decoded, so that the video buffer 22 (STD buffer) will not overflow.
[0237] More particularly, the multiplexer 14 rewrites SCR appended to the video pack including the picture Im2 so that while the picture Im2 starts being supplied as input at a time when STC-2 is “0” as indicated with a dotted line in FIG. 22, GOP(m) including the picture Im2 is supplied to the video buffer 22 at a new time scr(Im2) delayed a time indicated with D in FIG. 22 from the time of input of the picture Im2, thereby ending the operation with starting decoding of the picture Im2 at the time dts(Im2).
[0238] As having previously been described with reference to FIG. 13, the moving picture recording and/or removing apparatus 1 effecting the above-mentioned operations calculates a bit storage quantity Ba of the video buffer 22 (STD buffer), which should be when input of the last picture (picture B07 in FIG. 2c) of the outpoint-side video stream not re-encoded to the video buffer 22 ends, and determines, based on the bit storage quantity Ba, an allocated bit amount by determining the bit storage quantity Bos of the VBV buffer 31 for decoding the first picture (picture I12 in FIG. 2c) of the video stream re-encoded based on the bit storage quantity Ba. Thus, the outpoint-side video streams can be re-encoded and re-multiplexed of the video buffer 22 not to overflow and underflow when decoding the first picture (picture I12 in FIG. 2c) in the re-encoded outpoint-side video stream.
[0239] As having previously been described with reference to FIG. 17, the moving picture recording and/or reproducing apparatus 1 calculates a bit storage quantity Bj′ of the video buffer 22 (STD buffer) for decoding the first picture (picture Im2 in FIG. 2d) in the inpoint-side video stream not re-encoded, and determines, based on the bit storage quantity Bj′, a bit storage quantity Bj of the VBV buffer 31 for decoding the first picture (picture Im2 in FIG. 2d) in the video stream not re-encoded. Thus, the inpoint-side video stream can be re-encoded and re-multiplexed of the video buffer 22 (STD buffer) not to overflow and underflow when decoding the first picture (picture Im2 in FIG. 2d) in the video stream not re-encoded.
[0240] Therefore, for reproduction of Clip-1 and Clip-2 by concatenating them, the moving picture recording and/or reproducing apparatus 1 can reproduce Clip-1 and Clip-2 with no seam between them by re-encoding and re-multiplexing inpoint- and outpoint-side video streams without overflowing and underflowing of the video buffer 22, even with no referencing to information indicative of an initial status of a video buffer appended to each picture.
[0241] Note that the operations at step S27 and S28 may not be effected but the multiplexer 14 at step S26 may be allowed to re-multiplex at step S26 a range including not only the re-encoded video streams but also video packs supplied to the system target decoder 20 for a period from the time SCR_video2_start until the time when decoding of the first picture not re-encoded starts. Namely, the multiplexer 14 may be allowed to re-multiplex video packs supplied to the system target decoder 20 for a period from the time SCR_video2_start until the time dts(Im2) as shown in FIG. 16. Thus, the multiplexer 14 can prevent overflow of the video buffer 22, which would take place when re-multiplexing re-encoded inpoint-side video streams, and has not to rewrite SCR appended to each video pack.
[0242] Next, another example of re-encoding and re-multiplexing effected in the moving picture recording/and reproducing apparatus 1 will be described herebelow:
[0243]
FIGS. 23
a
to 23d show together the example of re-encoding of an outpoint-side video stream by the video encoder 13.
[0244] When a picture B11 of GOP(1) of outpoint-side video streams recorded in the optical disc 2 is designated as an outpoint picture (Pout) as shown in FIG. 23a, the video encoder 13 re-encodes the outpoint-side video stream as shown in FIGS. 23b, 23c or 23d.
[0245] As shown in FIG. 23b, the video encoder 13 re-encodes only GOP(1) of the outpoint-side video stream. That is, the video encoder 13 re-encodes a picture B10 of GOP(1) to an I picture I10x, and an outpoint picture B11 to a P picture P11x, to generate a new GOP(1-x).
[0246] Also, as shown in FIGS. 23c and 23d, the video encoder 13 re-encodes two GOPs, namely, GOP(0) and GOP(1).
[0247] As shown in FIG. 23c, the video encoder 13 re-encodes one GOP(0) and GOP(1) as one GOP(a-x). At this time, the video encoder 13 will copy pictures I02 to B07 of GOP(0) to GOP(a-x), re-encode the pictures B10 and B11 of GOP(1) to P pictures P10x and P11x, respectively, of GOP(a-x).
[0248] As shown in FIG. 23d, the video encoder 13 re-encodes GOP(0) and GOP(1) to two GOPs, namely, GOP(a-x1) and GOP(a-x2). At this time, the video encoder 13 will copy pictures I02 to B04 of GOP(0) to GOP(a-x1), re-encode pictures P08, B06 and B07 of GOP(0) to pictures I8x, B6x and B7x, respectively, of GOP(a-x2), and re-encode pictures B10 and B11 of GOP(1) to pictures P10x and P11x of GOP(a-x2). Note that in the example of re-encoding by the video encoder 13 shown in FIG. 23d, the maximum length of FOP is limited to 5 pictures.
[0249] For the above re-encoding, the video encoder 13 selects, based on the limitation by the video buffer 22 included in the system target decoder 20, any one of the re-encoding shown in FIG. 23b and that shown in FIG. 23c or 23d.
[0250]
FIGS. 24
a
to 24d show together an example of re-encoding of inpoint-side video streams.
[0251] When a picture Pn8 of GOP(n) of inpoint-side video streams recorded in the optical disc 2 is designated as an inpoint picture (Pin) as shown in FIG. 24a, the video encoder 13 re-encodes the inpoint-side video stream as shown in FIGS. 43b, 24c or 24d.
[0252] As shown in FIG. 24b, the video encoder 13 re-encodes only GOP(n) of the inpoint-side video stream. That is, the video encoder 13 re-encodes pictures Pn8, Pn6 and Bn7 of GOP(n) to I pictures I8x, Bn6x and Bn7x, respectively, to generate a new GOP(n-x).
[0253] Also, as shown in FIGS. 24c and 24d, the video encoder 13 re-encodes two GOPs, namely, GOP(n) and GOP(m).
[0254] As shown in FIG. 24c, the video encoder 13 re-encodes one GOP(n) and GOP(m) as one GOP(b-x). At this time, the video encoder 13 will re-encode pictures Pn8, Bn6 and Bn7 of GOP(n) to pictures In8x, Bn6x and Bn7x, respectively, re-encode the picture Im2 of GOP(m) to a P picture Pm2x, and re-encode a picture after the picture Im2 of GOP(m) to a picture of the same type, to generate a new GOP(b-x).
[0255] As shown in FIG. 24d, the video encoder 13 re-encodes GOP(n) and GOP(m) to two GOPs, namely, GOP(b-x1) and GOP(b-x2). At this time, the video encoder 13 will re-encode pictures Pn8, Bn6 and Bn7 of GOP(n) to pictures In8x, Bn6x and Bn7x, respectively, re-encode a picture Pm5x of GOP(m) to a picture Im5 of GOP(b-x2), and re-encode a picture after the picture Pm5 of GOP(m) to a picture of the same type.
[0256] For the above re-encoding, the video encoder 13 selects, based on the limitation by the video buffer 22 included in the system target decoder 20, any one of the re-encoding shown in FIG. 24b and that shown in FIG. 24c or 24d.
[0257] Next, the operations for re-encoding by the video encoder 13, having been described in the above with reference to FIG. 23, and re-multiplexing by the multiplexer 14, will be described with reference to the flow chart shown in FIG. 25. In FIG. 25, the steps of the same operations as in the flow chart in FIG. 13 are indicated with the same references as in FIG. 13, and will not be described in detail.
[0258] As in FIG. 25, first the operations at steps S11 to 13 are effected.
[0259] That is, the video encoder 13 will determine, at step S11, the type of each picture in a video data to re-encode. Namely, as having previously been described with reference to FIGS. 23a and 23b, when the picture B11 is an outpoint picture (Pout), the video encoder 13 determines the picture type for the picture B10 to be a picture I10x and picture B11 to be a picture P11x so that the picture B11 predictive-encoded based on the picture P15 can be made with no predictive referencing. The vide encoder 13 calculates the bit storage quantity Ba of the video buffer 22, which should be when the picture B07 is supplied to the video buffer 22, and determines, based on the bit storage quantity Ba, the bit storage quantity Bos of the VBV buffer 31 at step S12 for decoding the picture I10X. Then the video encoder 13 goes to step S31.
[0260] At step S31, the video encoder 13 determines an allocated bit amount for each of the pictures I10x and P11x of the video stream to re-encode.
[0261] Next at step S32, to re-encode with the allocated bit amount determined at step S31, the video encoder 13 calculates the bit storage quantity Bend1 of the VBV buffer 31, which should be after decoding the last picture P11x of the video stream to re-encode.
[0262] At step S33, the video encoder 13 makes comparison in size between the bit storage quantity Bend1 calculated at step S32 and the initial bit storage quantity Bvsd of the VBV buffer 31 for decoding the first picture in the inpoint-side video stream to re-encode. The initial bit storage quantity Bvsd is the bit storage quantity of the VBV buffer 31 for decoding the picture In8x as in FIG. 24.
[0263] When the video encoder 13 has judged that the bit storage quantity Bend1 is larger than the initial bit storage quantity Bvsd, it goes to step S15. When it has judged that the bit storage quantity Bend1 is smaller than the initial bit storage quantity Bvsd, it goes to step S34.
[0264] An example of a judgement made by the video encoder 13 at step S33, that the bit storage quantity Bend1 is larger than the initial bit storage quantity Bvsd, is shown in FIG. 25.
[0265] In FIG. 26, t( ) on the horizontal time base indicates a time when a picture to re-encode is decoded. For example, t(P08) indicates a time when a picture P08 is decoded. Also in FIG. 26, a( ) indicates a bit amount of a picture. For example, a(I10x) indicates a bit amount of a picture I10x. As shown in FIG. 26, if allocated bit amounts are determined by the video encoder 13 at step S31 for the pictures I10x and P11x in the video stream to re-encode, the data amounts indicated with a(I10x) and a(P11x), respectively, are deleted from the buffer when the pictures I10x and P11x are decoded ,and the video encoder 13 judges that the bit storage quantity Bend1 is larger than the initial bit storage quantity Bvsd. The video encoder 13 goes to step S15 where GOP(1-x) shown in FIG. 23b will be re-encoded.
[0266] An example of a judgment made by the video encoder 13 at step S33, that the bit storage quantity Bend1 is smaller than the initial bit storage quantity Bvsd, is shown in FIG. 27.
[0267] As shown in FIG. 27, if allocated bit amounts are determined by the video encoder 13 at step S31 for the pictures I10x and P11x in the video stream to re-encode, the data amounts indicated with a(I10x) and a(P11x), respectively, are deleted from the buffer when the pictures I10x and P11x are decoded, and the video buffer 13 judges that the bit storage quantity Bend1 is smaller than the initial bit storage quantity Bvsd. The video encoder 13 goes to step S34.
[0268] At step S15, the video encoder 13 re-encodes the outpoint-side video stream shown in FIG. 23b.
[0269] At step S34, the video encoder 13 changes the picture with which re-encoding starts to a picture belonging to a preceding GOP in the re-encoded order of GOPs. Namely, the video encoder 13 changes the picture I10x to re-encode as shown in FIG. 23b to a picture P10x belong to a preceding GOP(0), and changes a number of pictures to re-encode, thereby generating a new GOP(a-x) to re-encode as shown in FIG. 23c.
[0270] The video encoder 13 may be adapted to generate GOP(a-x1) and GOP(a-x2) shown in FIG. 23d from GOP(0) and GOP(1-x) shown in FIG. 23b. The video encoder 13 returns from step S34 to S11 where it will make operations at steps S11 to S33 for a to-be-re-encoded video stream selected by changing at step S34, and re-encodes and re-multiplexes the video stream at step S15.
[0271] By making the operation at step S34, the bit storage quantity of the video buffer 22 as shown in FIG. 25 is changed as shown in FIG. 28. As shown in FIG. 28, when the picture I10x in FIG. 23b is changed to the picture P10x shown in FIG. 23c and the allocated bit amounts are determined for the pictures P10X and P11x of the video stream to re-encoder again at step S31, the data mounts indicated with a(P10x) and a(P10x) when pictures P10x and P11x are deleted from the buffer and it is judged that the bit storage quantity Bend1 is larger than the initial bit storage quantity Bvsd. Then, the video encoder 13 goes to step S15 to re-encode GOP(a-x) shown in FIG. 23c where the re-encoding and re-multiplexing can be done.
[0272] Next, the operations for re-encoding by the video encoder 13 and re-multiplexing by the multiplexer 14, having previously been described with reference to FIG. 24, will be described with reference to the flow chart in FIG. 29. In FIG. 29, the steps of the same operations as in the flow chart in FIG. 17 are indicated with the same references as in FIG. 17, and will not be described in detail.
[0273] As in FIG. 29, first the operations at steps S21 to 23 are effected.
[0274] That is, the video encoder 13 will determine, at step S21, the type of each picture in a video data to re-encode. Namely, as having previously been described with reference to FIGS. 24a and 24b, when the picture Pn8 is an inpoint picture (Pin), the video encoder 13 determines the picture type for the picture Pn8 to be a picture In8x, picture Bn6 to be a picture Bn6x and picture Bn7 to be a picture Bn7x so that the picture Pn8 predictive-encoded based on the picture Pn5 can be made with no predictive referencing. The vide encoder 13 calculates the initial bit storage quantity Bj′ for decoding the picture Im2 at step S22, and determines the initial bit storage quantity Bj of the VBV buffer 31 for decoding the picture Im2 based on the initial bit storage quantity Bj′ at step S23. Then the video encoder 13 goes to step S41.
[0275] At step S41, the video encoder 13 determines an allocated bit amount for each of the pictures In8x, Bn6x and Bn7x of the video stream to re-encode.
[0276] Next at step S42, to re-encode with the allocated bit amount detennined at step S41, the video encoder 13 calculates the bit storage quantity Bend2 of the VBV buffer 31, which should be after decoding the last picture Bn7x of the video stream to re-encode.
[0277] At step S43, the video encoder 13 makes comparison in size between the bit storage quantity Bend2 calculated at step S42 and the initial bit storage quantity Bj.
[0278] When the video encoder 13 has judged that the bit storage quantity Bend2 is larger than the initial bit storage quantity Bj, it goes to step S25. When it has judged that the bit storage quantity Bend2 is smaller than the initial bit storage quantity Bj, it goes to step S44.
[0279] An example of a judgment made by the video encoder 13 at step S43, that the bit storage quantity Bend2 is larger than the initial bit storage quantity Bj, is shown in FIG. 30.
[0280] As shown in FIG. 30, if allocated bit amounts are determined by the video encoder 13 at step S41 for the pictures In8x, Bn6x and Bn7x in the video stream to re-encode, the data amounts indicated with a(In8x), a(Bn6x) and a(Bn7x), respectively, are deleted from the buffer when the pictures In8x, Bn6x and Bn7x are decoded ,and the video encoder 13 judges that the bit storage quantity Bend2 is larger than the initial bit storage quantity Bj. The video encoder 13 goes to step S25 where GOP(a-x) shown in FIG. 24b will be re-encoded.
[0281] At step S25, the video encoder 13 re-encodes the inpoint-side video stream shown in FIG. 24b, the multiplexer 14 re-multiplexes the video stream re-encoded at step S26 according to the limitation of the video buffer 22, and the operations are ended with the operations at steps S27 and S28 so that the video buffer 22 will not overflow when the multiplexed data is reproduced.
[0282] An example of a judgment made by the video encoder 13 at step S43, that the bit storage quantity Bend2 is smaller than the initial bit storage quantity Bj, is shown in FIG. 31.
[0283] As shown in FIG. 31, if allocated bit amounts are determined at step S41 by the video encoder 13 for the pictures In8x, Bn6x and Bn7x in the video stream to re-encode, the data amounts indicated with a(In8x), a(Bn6x) and a(Bn7x), respectively, are deleted from the buffer when the pictures In8x, Bn6x and Bn7x are decoded, and the video buffer 13 judges that the bit storage quantity Bend2 is smaller than the initial bit storage quantity Bj.
[0284] Also as shown in FIG. 31, the video encoder 13 cannot successively re-encode GOP(n-z) to re-encode and GOP(m) not to re-encode so that the bit storage quantity depicts a continuous trajectory. That is, a trajectory A depicted by the bit storage quantity of GOP(n-x) decoded after supplied to the VBV buffer 31 does not coincide with a trajectory B depicted by the bit storage quantity of GOP(m) decoded after supplied to the VBV buffer 31.
[0285] At step S44, the video encoder 13 changes the picture type so as to re-encode GOP(n) and GOP(m) as one GOP(b-x) and then returns to step S21. More specifically, the video encoder 13 changes the picture Im2 shown in FIG. 24b to a picture Pm2x to change the number of pictures and changes the number of pictures to re-encode, thereby generating new GOP(b-x) to re-encode as shown in FIG. 24c. At step S44, the video encoder 13 makes operations at steps S21 to S42 on video data newly generated at step S44, and then makes operations at steps S25 and subsequent steps. With the operation at step S44, the video encoder 13 will change the bit storage quantity of the video buffer 22 shown in FIG. 31 as shown in FIG. 32.
[0286] As will be seen from FIG. 32, in the moving picture recording and/or reproducing apparatus 1, when the allocated bit amounts for the pictures In8x, Bn6x and Bn7x in the video stream to re-encoded at step S41 are detennined by changing the picture Im2 in FIG. 24b to a picture Pm2x shown in FIG. 24c, data amounts a(In8x), a(Bn6x) and a(Bn7x) take place when the pictures In8x, Bn6x and Bn7x are decoded. Thus, it is judged that the bit storage quantity Bend2 is larger than the initial bit storage quantity Bj. The video encoder 13 will go to step S25 to decode GOP(a-x) shown in FIG. 24c. At step S25, the re-encoding and re-multiplexing can be done.
[0287] Also as seen from FIG. 32, the video encoder 13 can re-encode GOP(n-x) to re-encode and GOP(m) not to re-encode successively so that the bit storage quantity will depict a continuous trajectory. That is, when pictures Bn7x and Pm2 are successively decoded, the bit storage quantity depicts a continuous trajectory.
[0288] As having been described in the foregoing, in the moving picture recording and/or reproducing apparatus 1, when it is determined at step S33 that the bit storage quantity Bend1 is smaller than the initial bit storage quantity Bvsd, the picture I10x to re-encode is changed at step S34 to a picture P10x belonging to a preceding GOP(0) as shown in FIG. 23b to generate a new GOP(a-x) to re-encode as shown in FIG. 23c. Thus it is possible to inhibit the bit storage quantity of the video buffer 22 from abruptly decreasing, as shown in FIGS. 27 and 28. Therefore, in the moving picture recording and/or reproducing apparatus 1, it is possible to re-encode an outpoint-side video data to a higher image quality and re-multiplex the data with a high image quality.
[0289] Also in the moving picture recording and/or reproducing apparatus 1, when it is determined at step S43 that the bit storage quantity Bend2 is smaller than the initial bit storage quantity Bj, the picture Im2 to re-encode at step S44 s shown in FIG. 24b for example is changed to a picture Pm2x to generate a new GOP(b-x) to re-encode as shown in FIG. 24c. Thus, when the inpoint-side video data is re-encoded, the bit storage quantity of the video buffer 22 can depict a continuous trajectory as shown in FIGS. 31 and 32. Therefore, with the moving picture recording and/or reproducing apparatus 1, it is possible to re-encode the outpoint-side video data with higher image quality and re-multiplex it with a high image quality.
[0290] In the foregoing, the moving picture recording and/or reproducing apparatus 1 has been described concerning an example of program stream to which SCRs are appended in succession as defined in the MPEG-2 standard. However, the present invention is not limited to such a program stream but it is applicable to a transport stream for multiplexing multiple programs. In case of a transport stream, the moving picture recording and/or reproducing apparatus 1 refers to a program check reference (PCR), not to SCR and uses T-STD for STD, for calculation of the bit storage quantity of the video buffer 22.
[0291] Multiplexed streams in the form of transport stream include PCR packet storing a program clock reference (PCR) indicative of a timing of output to the system target decoder 40, packetized elementary stream (PES) of video data to which DTS indicative of decoding timing and PTS indicative of output timing for decoded data are appended as additional information, and consisting of transport packets, PES packet of audio data to which PTS is appended as additional information, and consisting of transport packets, and transport packets intended for transmission of system data. Namely, the multiplexed stream includes a plurality of time-division multiplexed programs. The multiplexed stream has additional information appended thereto for control of the decoding timing and output timing.
[0292]
FIG. 33 is a block diagram of a system target decoder 40 to decode re-multiplexed streams multiplexed in the form of a transport stream by the moving picture recording and/or reproducing apparatus 1. In FIG. 33, the same components and elements as in the system target decoder 20 are indicated with the same or similar references as in the system target decoder 20, and will not be described in detail.
[0293] As seen, the system target decoder 40 is similar to the system target decoder 20 in FIG. 6 provided that it is supplied with a multiplexed stream consisting of multiplexed transport streams.
[0294] The system target decoder 40 includes a demultiplexer 41. Supplied with the multiplexed stream, the demultiplexer 41 reads a packet identifier (PID) included in a packet header of each of multiplexed transport streams, and judges, based on the value of the PID of which type the data stored in a payload is, video, audio or system data. Depending upon the result of the judgment based on the PID, the demultiplexer 41 provides a video transport packet, audio transport packet or system transport packet to a video transport buffer 42, audio transport buffer 43 and system transport buffer 44. At this time, the demultiplexer 41 will shift the connection between a connector 41a thereof and terminals connected to the buffers 42 to 44 depending upon the PID value.
[0295] The video transport buffer 42 sends only a payload portion (PES packet) of the video transport packet to a multiplexing buffer 45, and sends it as an elementary stream to a video elementary buffer 46.
[0296] Audio transport packet and system transport packet are sent directly to an audio main buffer 47 and system main buffer 48 as audio elementary stream and system elementary stream from the audio transport buffer 43 and system transport buffer 44, respectively.
[0297] The elementary streams stored in the video elementary buffer 46, audio main buffer 47 and system main buffer 48 are removed from the respective buffers 46 to 48 at a DTS-defined time, and supplied to decoders 49 to 51 where they will be decoded.
[0298] At shift from the outpoint-side program to the inpoint-side program in data reproduction by concatenating outpoint and inpoint vide streams to each other, the timing controller 28 generates two STCs, namely, STC-1 synchronous with PCR of the outpoint-side program and STC-2 synchronous with the inpoint-side program.
[0299] Re-encoding of the transport stream is effected by the video elementary buffer 46 in such a manner that the video elementary buffer 46 will not to overflow and underflow as in the re-encoding of the program stream.
[0300] The re-multiplexing of the transport stream is effected form each buffer of the T-STD to meet the following requirements (1) to (3) prescribed in the MPEG-2 standard:
[0301] 1. The transport buffers 42 to 44 in which various packets are stored should be blank at least once a second without no overflowing.
[0302] 2. The video multiplexing buffer 45 should be blank at least once a second with no overflowing.
[0303] 3. The video elementary buffer 46 and the main buffers 47 and 48 for other streams should not overflow and underflow.
[0304] The system target decoder 40 should meet the above-mentioned requirements (1) to (3) when re-multiplexing the data except when the PCR value is discontinued by the edit point. In the system target decoder 40, shifting of the time base from STC-1 to STC-2 before and after the edit point is effected as in the processing of the program stream.
[0305] Different from the system target decoder 20 for the program stream, the system target decoder 40 for the transport stream cannot decode video and audio elementary streams before system data and PCR sent by a program association table (PAT) and program map table (PMT) are acquired. Therefore, if PIDs before and after the edit point include one different one, the top of re-multiplexed Clip-2 should include PAT, PMT and PCR in this order.
[0306] PCR is discontinued by the edit point. A discontinuity information table (DIT) may be inserted at the edit point to inform the system target decoder of such a discontinuity.
[0307] In the foregoing, the moving picture recording and/or reproducing apparatus 1 has been explained concerning an example that for edition to concatenate Clip-1 including designated outpoint pictures and Clip-2 including designated inpoint pictures, vide streams are re-encoded and re-multiplexed. However, the present invention is not limited to this example, but it can be applied to an edition for insertion of a new video stream into a multiplexed stream, for example. At this time, in the moving picture recording and/or reproducing apparatus 1, to prevent the video buffer 22 from overflowing and underflowing, a bit storage quantity is calculated of the video buffer 22 for re-encoding and re-multiplexing of multiplexed streams before and after a new video stream inserted in the existing video stream.
Claims
- 1-17. (canceled)
- 18. A computer program recorded on a recordable medium for performing an encoding process, comprising the steps of:
calculating, for a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams, a first bit storage quantity which should be when input of a first picture of a first encoded stream ending with the first picture to the video buffer ends; calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for starting, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the end of the first picture and beginning with the second picture; re-encoding the second encoded stream based on the second bit storage quantity; and generating, based on the first bit storage quantity, a multiplexed stream including the re-encoded second encoded stream.
- 19. A computer program recorded on a recordable medium for performing an encoding process, comprising the steps of:
calculating, for a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams, a first bit storage quantity which should be when input of a first picture of a first encoded stream ending with the first picture to the video buffer ends; calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for starting, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the end of the first picture and beginning with the second picture; re-encoding the second encoded stream based on the second bit storage quantity; and changing a number of pictures included in the second encoded stream based on the second bit storage quantity to re-encode the second encoded stream whose number of pictures is changed.
- 20. A computer program recorded on a recordable medium for performing an encoding process, comprising the steps of:
calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams should have for decoding a first picture at the top of a first encoded stream; calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer should have for ending, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the beginning of the first picture and ending with the second picture; re-encoding the second encoded stream based on the second bit storage quantity; and changing a number of pictures included in the second encoded stream based on the second bit storage quantity to re-encode the second encoded stream whose number of pictures is changed.
Priority Claims (2)
Number |
Date |
Country |
Kind |
P11-154402 |
Jun 1999 |
JP |
|
P2000-090769 |
Mar 2000 |
JP |
|
Continuations (1)
|
Number |
Date |
Country |
Parent |
09583422 |
May 2000 |
US |
Child |
10861748 |
Jun 2004 |
US |