WO2005122585A1 - Method and apparatus for editing data streams - Google Patents

Method and apparatus for editing data streams Download PDF

Info

Publication number
WO2005122585A1
WO2005122585A1 PCT/JP2005/011182 JP2005011182W WO2005122585A1 WO 2005122585 A1 WO2005122585 A1 WO 2005122585A1 JP 2005011182 W JP2005011182 W JP 2005011182W WO 2005122585 A1 WO2005122585 A1 WO 2005122585A1
Authority
WO
WIPO (PCT)
Prior art keywords
data stream
frames
buffer
encoding
frame
Prior art date
Application number
PCT/JP2005/011182
Other languages
French (fr)
Inventor
Ju-Yun Cheng
Hon-Wen Pon
Original Assignee
Matsushita Electric Industrial Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co., Ltd. filed Critical Matsushita Electric Industrial Co., Ltd.
Publication of WO2005122585A1 publication Critical patent/WO2005122585A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23424Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23406Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving management of server-side video buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements

Definitions

  • This invention relates to a method and apparatus for editing data streams, more particularly to a method and apparatus for merging a plurality of data streams.
  • MPEG Motion Picture Expert Group
  • ISO International Standard Organization
  • a data stream is a representation of video and audio data using a series of "0" and "1.” In order to render such a series of "0” and “1” meaningful, the series of "0” and “1” has to be encoded.
  • a data stream includes three different types of frames or pictures, namely, I frames (Intra-coded Picture), P frames (Predictive-coded Picture), and B frames (Bi- directionally Predictive-coded Picture).
  • a group of pictures is a combination of the aforesaid frames.
  • I frames are encoded without reference to a preceding frame or a following frame
  • P frames and B frames are encoded with motion compensation.
  • a P frame is encoded with reference to a preceding I frame or P frame
  • a B frame is encoded with reference to immediately preceding and immediately following I or P frames. Therefore, the I frame has the largest amount of data, whereas the B-frame has the least amount of data.
  • a video buffer verifier (VBV) buffer in a decoder will allocate a relatively large buffer area to an I frame, and will allocate a relatively small buffer area to a B frame.
  • VBV video buffer verifier
  • a buffer disposed in the decoder will, with the input of the frames, allocate buffer areas to the frames, respectively.
  • the vertical lines represent the sizes of the buffer areas allocated to the frames by the buffer.
  • the oblique lines in the figure have the same slope.
  • the slope of the oblique lines represents the data transmission rate at which the data of the frames is inputted into the buffer. If the sum of the buffer amount allocated to the frames and the original buffer size is greater than the largest buffer amount, overflow of the buffer will result.
  • the display order of a group of pictures is different from the processing order thereof.
  • the display order is the arrangement sequence of the group of pictures when displayed on a screen
  • the processing order is the sequence of processing of the group of pictures during decoding of the group of pictures.
  • the display order of a group of pictures is IBBPBBP, and the frames to which the display order correspond are numbered 0, 1, 2...6, in sequence.
  • the processing order of the group of pictures becomes IPBBPBB, and the numbers corresponding to the processing order are 0, 3, 1, 2, 6, 4, and 5.
  • the decoding of B frames requires reference to the data of the I and P frames in order to completely decode the B frames. Therefore, the processing order is to decode the I frames before decoding the P frames, and to decode the B frames by referring to the decoded I and P frames.
  • the buffer will have an underflow situation.
  • the last frame in the new data stream refers to a frame after the splicing point. If such is the case, it is necessary to re-encode the data stream so that the frames in the data stream will not refer to any frame after the splicing point.
  • a conventional method is to reduce the buffer amount allocated by the buffer to the I frames during decoding. However, this will seriously affect the picture quality of the decoded pictures.
  • an object of the present invention is to provide a method for editing data streams, in which a plurality of data streams can be edited into a data stream and in which occurrence of buffer underflow when an edited data stream passes through a buffer is prevented.
  • Another object of this invention is to provide an apparatus for editing data streams, which can be used to edit data streams with a relatively small number of frames.
  • a method for editing data streams of this invention is adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer.
  • the method comprises the following steps: (1) based on positions of the first and second splicing points, determining the frames in the data streams A and B which require re-encoding and the frames which need to be retained therein, and recording an end value and a start value, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer, the start value being size of the buffer amount of the buffer after a frame, which precedes the first frame in the data stream A that requires re-encoding, passes through the buffer; (2) determining whether the start value is smaller than the end value, and executing steps (3), (4), (5), (6), and (7) in sequence if the start value is smaller than or equal to the end value, and otherwise executing steps (8), (9), (10), and (11) if the start value is larger than the end value; (3) setting an intermediate buffer value; (4) decoding the frames in the data stream A and the
  • the apparatus for editing data streams which is constructed usi ng the aforesaid method includes a controller, a decoding unit, a re-encoding unit, and an integrator.
  • the controller can determine the frames in the data streams A and B which require re-encoding and which need to be retained based on positions of the first and second splicing poi nts , set an intermediate buffer value, record an end value and a start val ue , and compare sizes of the start value and the end val ue so as to generate correspondi ng actions.
  • the end value i s the size of a buffer a mount of the buffer after a frame , which is at the same position as the last frame requiring re- encoding in the data stream B prior to editing of the data stream B, passes through the buffer.
  • the start value is the size of a buffer amount of the buffer after a frame, which precedes the first frame in the data stream A requi ring re- encoding , passes through the buffer.
  • the control ler merges the frames i n the data streams A and B whi ch require re-encoding into a group when the start value is l arger than the end val ue.
  • the decoding unit is connected el ectrically to the controller, and can decode the frames.
  • the re-encoding unit is connected electrically to the controller and the decoding unit, and can re-encode the frames decoded by the decoding unit.
  • the integrator is connected electrically to the re-encoding unit and the controller, and can integrate the re-encoded frames and the retained frames into the edited data stream C.
  • the controller When the controller determines that the start value is smaller than or equal to the end value, the controller will control the re-encoding unit such that, when the re-encoding unit is performing re-encoding, the buffer amount of the buffer can be maintained at the intermediate buffer value after the last re-encoded frame in the data stream A passes through the buffer, and the buffer amount after the last frame requiring re- encoding in the data stream B passes through the buffer is consistent with the end value.
  • the controller determines that the start value is larger than the end value, the controller will control the re-encoding unit to cause the re-encoding unit to re-encode the group into a group of pictures such that the buffer amount after the group of pictures has completely passed through the buffer is consistent with the end value.
  • the effect of this invention resides in that only a small number of frames need to be re-encoded when two data streams are edited into a data stream so that occurrence of underflow when the edited data stream passes through the buffer can be prevented. Besides, the computational- speed can be increased, and the invention can be applied to data streams with a relatively small number of frames.
  • Figure 1 is a schematic diagram illustrating the situation that, when a decoder is decoding a group of pictures, a buffer in the decoder allocates buffer areas to the frames, respectively, with the input of the frames;
  • Figures 2 is a schematic diagram illustrating the display order, the display order numbers, the processing order, and the processing order numbers of the frames in the group of pictures;
  • Figure 3 is a system block diagram of a preferred embodiment of a method and apparatus for editing data streams according to this invention;
  • Figure 4 is a flowchart of the method of the preferred embodiment;
  • Figure 5 is a schematic diagram of the preferred embodiment, illustrating frames in a data stream A and a data stream B; and
  • Figure 6 is a schematic diagram of the preferred embodiment, illustrating size of an intermediate buffer value.
  • an apparatus for editing data streams includes a controller 1, a decoding unit 2, a re-encoding unit 3, and an integrator 4.
  • frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point are edited into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer (not shown).
  • the first and second splicing points can be set by the user according to actual requirements.
  • the data streams A and B are in MPEG-2 compression format, and have the same group of pictures.
  • the method for editing data streams according to this invention includes the following steps: In step 81, the controller 1 determines the frames in the data streams A and B which need to be re-encoded, retained, or deleted according to the first and second splicing points. With reference to Figure 5, Figure 5 shows the display order, the display order numbers, the processing order, and the processing order numbers of the data streams A and B, respectively, and indicates the positions of the splicing points.
  • the processing order of the group of pictures of each of the data streams A and B is IPBBPBBPBBPBBPBBPBBPBBPBB....
  • the first splicing point is located between the frames in the data stream A which have display order numbers 17 and 18, whereas the second splicing point is located between the frames in the data stream B which have display order numbers 7 and 8.
  • the controller 1 will delete the frames in the data stream A which have a display order number larger than or equal to 18, and will delete the frames in the data stream B which have a display order number smaller than or equal to 7.
  • the controller 1 uses two rules to determine the frames that need to be re-encoded.
  • the first rule is that a P or B frame cannot be the start frame of a data stream.
  • the second rule is that the last frame of the data stream cannot refer to a frame after the splicing point. If a frame meets one of the aforesaid two conditions, the frame requires re-encoding. Therefore, based on these two rules, the controller 1 can determine that the frames in the data stream which require re- encoding are frames B, B which are shown in Figure 5 by hatching with oblique strokes, and the frames in the data stream B which require re-encoding are frames P and B which are shown in Figure 5 by hatching with oblique strokes. Apart from the frames that require re-encoding, the controller 1 will retain the frames that do not require re-encoding.
  • the processing order of the frames retained in the data stream A at this point is, in sequence, IPBBPBBPBBPBBPBBP
  • the processing order of the frames retained in the data stream B is, in sequence, PBBPBBPBBPBBPBB....
  • the controller 1 determines the situation of the data streams passing respectively through the buffer prior to editing, and records a start value and an end value.
  • the start value is the size of the buffer amount of the buffer after a frame preceding the first frame requiring re-encoding in the data stream A passes through the buffer
  • the end value is the size of the buffer amount of the buffer after a frame in the data stream B which is at the same position as the last frame requiring re- encoding as determined in step 81 passes through the buffer.
  • the controller 1 determines whether the start value is smaller than the end value. If the start value is smaller than or equal to the end value, the flow proceeds to step 84. Otherwise, the flow skips to step 94.
  • step 84 the controller 1 sets an intermediate buffer value based on the sizes of the start value and the end value.
  • the time to which the intermediate buffer value corresponds is between the times to which the start value and the end value correspond.
  • the decoding unit 2 decodes the frames in the data stream A which have been determined to require re- encoding.
  • the re-encoding unit 3 re-encodes the frames decoded in step 85.
  • the controller 1 will supply the intermediate buffer value to the re-encoding unit 3 to enable the re-encoding unit 3 to encode all of the frames in the data stream A which require re-encoding based on the intermediate buffer value such that, under the condition that the compression quality is not degraded, the buffer amount of the buffer after the last frame passes through the buffer could be maintained at the intermediate buffer value.
  • the re-encoding unit 3 converts frames B, B to frames P, B by re-encoding.
  • the frames in the front half of the data stream A and the frames in the rear half of the data stream B are omitted in Figure 6.
  • the intermediate buffer value is set to be relatively large, this represents that the buffer amount available for use by the frames in the data stream A which require re-encoding is small. Therefore, the picture quality of the frames requiring re- encoding will drop.
  • a larger intermediate buffer value will cause the buffer amount to be closer to the largest buffer amount that can be accommodated by the buffer, and can therefore provide more buffer amount for use by the first I frame in the data stream B.
  • the start I frame in the data stream B can also have a sufficient buffer amount for use, thereby ensuring the picture quality of the data stream B.
  • the controller 1 will set the size of the intermediate buffer value according to actual use conditions.
  • step 87 the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer can be maintained at the intermediate buffer value. In the affirmative, the flow skips to step 89. Otherwise, the flow proceeds to step 88. In this example, supposing the buffer amount after the last frame requiring re-encoding passes through the buffer cannot be maintained at the intermediate buffer value without affecting the compression quality, the flow proceeds to step 88.
  • step 88 the controller 1 increases the frames in the data stream A which require re-encoding so that the frames requiring re-encoding in the data stream A do not solely include the two frames B, B determined in step 81.
  • the flow skips back to step 85 to perform steps 85, 86, 87 and 88 in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the intermediate buffer value.
  • the number of frames that the controller 1 finally needs to re-encode is 15.
  • the buffer amount of the buffer can be maintained at the intermediate buffer value under the condition that the compression quality is not affected. Moreover, the processing order of the frames retained in the data stream A at this time is changed to IPB.
  • the decoding unit 2 decodes the frames in the data stream B which require re-encoding.
  • the re-encoding unit 3 re-encodes the decoded frames in the data stream B, and, under the condition that the compression quality is not degraded, the re-encoding unit 3 will attempt to bring the buffer amount after buffering of the last re- encoded frame into consistence with the end value.
  • step 90 is executed for the first time, the frames P, B in the data stream B which require re-encoding are re-encoded into frames
  • step 91 the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In the affirmative, the flow skips to step 93. Otherwise, the flow proceeds to step 92. In this example, supposing the buffer amount after the last frame requiring re-encoding passes through the buffer cannot be maintained at the end value without affecting the compression quality, the flow proceeds to step 92. In step 92, the controller 1 increases the frames in the data stream B which require re-encoding so that the frames requiring re-encoding in the data stream B do not solely include the two P, B frames determined in step 81.
  • step 92 After completion of the execution of step 92, the flow skips back to step 89, and steps 89, 90, 91 are carried out in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value.
  • the buffer amount of the buffer can be maintained at the end value when the number of frames requiring re-encoding reaches 15.
  • the processing order of the frames retained in the data stream B is, in sequence, PBB....
  • step 93 the integrator 4 adds the retained frames to the re-encoded frames to transform the data stream A into a new data stream A', and the processing order of the data stream A' is IPBBPBBPBBPBBPBBPB.
  • the data stream B is also transformed into a new data stream B', and the processing order of the data stream B' is, in sequence, IPPBBPBB....
  • the data stream B' is arranged after the data stream A' to obtain an edited data stream C.
  • the processing order of the data stream C is IPBBPBBPBBPBBPBBPBIPPBBPBB....
  • step 83 if the controller 1 determines that the start value is larger than the end value, the flow skips to step 94.
  • step 94 the controller 1 merges the frames in the data streams A and B which require re-encoding into a group. Therefore, when step 94 is executed for the first time, the frames B, B in the data stream A and the frames B, P in the data stream B are merged according to the processing order to form a group of frames BBPB.
  • step 95 the decoding unit 2 decodes the group obtained in step 94.
  • step 96 the re-encoding unit 3 re-encodes the frames decoded in step 95. Moreover, the re-encoding unit 3 will attempt to control the buffer amount after the group of frames has completely passed through the buffer to be the same as the end value under the condition that the compression quality is not degraded.
  • step 96 When step 96 is executed for the first time, a group of frames IPBB will be obtained.
  • step 97 the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In the affirmative, the flow skips to step 99. Otherwise, the flow proceeds to step 98.
  • step 98 the controller 1 increases the frames requiring re-encoding so that the frames which require re-encoding do not include the four frames BBPB determined in step 94 only. After completion of the execution of step 98, the flow skips back to step 94, and steps 94, 95, 96, and 97 are carried out in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value.
  • the integrator 4 integrates the retained frames and the re-encoded frames into a new data stream D, in which the front half portion of the frames according to the processing order of the data stream D are the frames IPBB retained in the data stream A, whereas the frames in the rear half portion are the frames PBB... retained in the data stream B.
  • the frames between the front half portion and the rear half portion are the re-encoded group of pictures IPBBPBBPBBPBB... PB.
  • the processing order of the edited data stream D is IPBB IPBBPBBPBBPBB... PBPBB....
  • frames requiring re-encoding may be increased in step 81 according to experience or actual use conditions so that the frames requiring re-encoding do not merely include the frames determined based on the two rules. For example, by setting the number of frames requiring re-encoding to 15, repetitions of step 88 or step 92 can be reduced or avoided, thereby increasing the overall computational speed.
  • the number of frames requiring re-encoding may also be increased in step 94 to reduce the number of times of repeating step 98.
  • this embodiment can also be used when there is only one data stream. That is, when there is only one data stream, and the data stream has two splicing points at different positions, the frames between the two splicing points are deleted, and the remaining data stream segments preceding and following the splicing points are edited so as to merge the segments into a new data stream.
  • this invention can edit two data streams A and B into a data stream, and can eliminate the problem of underflow when the edited data stream passes through the buffer.
  • the essential technical feature resides in that the controller 1 initially determines the situations when the data streams A and B pass respectively through the buffer prior to editing, and records a start value and an end value.
  • the re-encoding unit 3 re-encodes some of the frames properly so that the buffer amount required for buffering the new data stream C or D, for which editing has been completed, through the buffer is consistent with the start value and the end value under the condition that the frames are identical so as to prevent buffer underflow.
  • this invention not only provides a faster computational speed compared with the prior art, it can also be used to edit data streams with a relatively small nu mber of frames. Furthermore, as this invention can dynamical ly i ncrease the frames requiri ng re-encoding , better compression quality can be ensu red . Thus , the objects of thi s invention can be positively achieved .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

A method and apparatus for editing data streams is adapted for editing frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C. The controller determines the frames in the data streams A and B which require re-encoding and which need to be retained based on positions of the splicing points, and sets an intermediate buffer value, a start value, and an end value. The decoding unit decodes the frames requiring re-encoding. The re-encoding unit re-encodes the decoded frames such that the buffer amount after the last frame requiring re-encoding in the data stream B passes through the buffer is consistent with the end value. The integrator integrates the re-encoded frames and the retained frames into the data stream C.

Description

DESCRIPTION
METHOD AND APPARATUS FOR EDITING DATA STREAMS
Technical Field This invention relates to a method and apparatus for editing data streams, more particularly to a method and apparatus for merging a plurality of data streams.
Background Art Motion Picture Expert Group (MPEG) is one of the international standards for dynamic image compression, and was established by the International Standard Organization (ISO) for video and audio information compression. It is also a standard specifying the format of data streams. A data stream is a representation of video and audio data using a series of "0" and "1." In order to render such a series of "0" and "1" meaningful, the series of "0" and "1" has to be encoded. Generally, a data stream includes three different types of frames or pictures, namely, I frames (Intra-coded Picture), P frames (Predictive-coded Picture), and B frames (Bi- directionally Predictive-coded Picture). A group of pictures (GOP) is a combination of the aforesaid frames. I frames are encoded without reference to a preceding frame or a following frame, whereas P frames and B frames are encoded with motion compensation. In addition, a P frame is encoded with reference to a preceding I frame or P frame, whereas a B frame is encoded with reference to immediately preceding and immediately following I or P frames. Therefore, the I frame has the largest amount of data, whereas the B-frame has the least amount of data. Thus, during decoding, a video buffer verifier (VBV) buffer in a decoder will allocate a relatively large buffer area to an I frame, and will allocate a relatively small buffer area to a B frame. Referring to Figure 1, when a decoder is decoding a group of pictures, a buffer disposed in the decoder will, with the input of the frames, allocate buffer areas to the frames, respectively. The vertical lines represent the sizes of the buffer areas allocated to the frames by the buffer. Thus, the vertical lines for the l-frames which are allocated with the largest buffer areas are longest. The oblique lines in the figure have the same slope. The slope of the oblique lines represents the data transmission rate at which the data of the frames is inputted into the buffer. If the sum of the buffer amount allocated to the frames and the original buffer size is greater than the largest buffer amount, overflow of the buffer will result. However, if the sum of the consumed (allocated) buffer amount and the original buffer size is less than the least buffer amount, underflow of the buffer will result. Buffer underflow in turn will result in a situation where the buffer cannot provide any data when it is desired to acquire frame data from the buffer during the course of data processing. Additionally, the display order of a group of pictures is different from the processing order thereof. The display order is the arrangement sequence of the group of pictures when displayed on a screen, whereas the processing order is the sequence of processing of the group of pictures during decoding of the group of pictures. As shown in Figure 2, the display order of a group of pictures is IBBPBBP, and the frames to which the display order correspond are numbered 0, 1, 2...6, in sequence. However, the processing order of the group of pictures becomes IPBBPBB, and the numbers corresponding to the processing order are 0, 3, 1, 2, 6, 4, and 5. This is because the decoding of B frames requires reference to the data of the I and P frames in order to completely decode the B frames. Therefore, the processing order is to decode the I frames before decoding the P frames, and to decode the B frames by referring to the decoded I and P frames. When editing data streams, it is often necessary to delete frames in the front half, frames in the rear half, or a part of middle frames of a data stream, or to connect two different data streams after deleting a part of the frames. When there are changes in the frames in a data stream, buffer underflow will result upon buffering of the data stream through a buffer in the decoder due to discontinuity of the data stream. The causes for the underflow will be explained in detail hereinbelow. Since decoding of a P or B frame requires reference to a preceding frame, they cannot be the start frame of a data stream. During editing of a data stream, if the front part of the data is deleted, the first frame of the new data stream may be a P or B frame due to the site of the splicing point. Therefore, the data stream must be re-encoded to change the first frame into an I frame. However, since an I frame will consume a relatively large number of bits in the buffer, the buffer must compensate the increased number of bits. However, during the process of compensation, if the buffer amount is less than the least buffer amount of the buffer, the buffer will have an underflow situation. When the rear part of the data of a data stream is deleted, it should be noted whether the last frame in the new data stream refers to a frame after the splicing point. If such is the case, it is necessary to re-encode the data stream so that the frames in the data stream will not refer to any frame after the splicing point. In the prior art, when an encoded data stream is being edited, in order to avoid the occurrence of underflow when an edited data stream passes through a buffer, a conventional method is to reduce the buffer amount allocated by the buffer to the I frames during decoding. However, this will seriously affect the picture quality of the decoded pictures. Since P and B frames have to refer to I frames, if the picture quality of the I frames is poor, the overall picture quality will be reduced. Another conventional method is described in U.S. Patent No. 6529555 B1. According to this method, data streams containing I, P, and B frames are all re-encoded to contain I frames only, and the number of the frames that need to be re- encoded is lengthened so that the buffer amount that the buffer intends to reduce can be distributed to a larger number of frames so as to resolve buffer underflow to thereby maintain the picture quality at an even level. However, because the number of frames required to be re-encoded is large, this method takes a considerable amount of processing time. Besides, since this method requires augmentation of the number of re-encoded frames, it is not suitable for data streams with a relatively small number of frames.
Disclosure of Invention Therefore, an object of the present invention is to provide a method for editing data streams, in which a plurality of data streams can be edited into a data stream and in which occurrence of buffer underflow when an edited data stream passes through a buffer is prevented. Another object of this invention is to provide an apparatus for editing data streams, which can be used to edit data streams with a relatively small number of frames. Accordingly, a method for editing data streams of this invention is adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer. The method comprises the following steps: (1) based on positions of the first and second splicing points, determining the frames in the data streams A and B which require re-encoding and the frames which need to be retained therein, and recording an end value and a start value, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer, the start value being size of the buffer amount of the buffer after a frame, which precedes the first frame in the data stream A that requires re-encoding, passes through the buffer; (2) determining whether the start value is smaller than the end value, and executing steps (3), (4), (5), (6), and (7) in sequence if the start value is smaller than or equal to the end value, and otherwise executing steps (8), (9), (10), and (11) if the start value is larger than the end value; (3) setting an intermediate buffer value; (4) decoding the frames in the data stream A and the data stream B which require re-encoding, respectively; (5) re-encoding the frames decoded from the data stream A, such that the buffer amount of the buffer can be maintained at the intermediate buffer value after the last re- encoded frame passes through the buffer; (6) re-encoding the frames decoded from the data stream B, such that the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value; (7) adding the retained frames to the re-encoded frames obtained in steps (5) and (6) to yield the edited data stream C; (8) merging the frames requiring re-encoding in the data streams A and B into a group; (9) decoding the group; (10) re-encoding the group into a group of pictures such that the buffer amount after the group of pictures has completely passed through the buffer is consistent with the end value; and (11 ) adding the frames retained in step (1 ) to the group of pictures that was re-encoded i n step ( 1 0) to form the edited data stream C . The apparatus for editing data streams which is constructed usi ng the aforesaid method includes a controller, a decoding unit, a re-encoding unit, and an integrator. The controller can determine the frames in the data streams A and B which require re-encoding and which need to be retained based on positions of the first and second splicing poi nts , set an intermediate buffer value, record an end value and a start val ue , and compare sizes of the start value and the end val ue so as to generate correspondi ng actions. The end value i s the size of a buffer a mount of the buffer after a frame , which is at the same position as the last frame requiring re- encoding in the data stream B prior to editing of the data stream B, passes through the buffer. The start value is the size of a buffer amount of the buffer after a frame, which precedes the first frame in the data stream A requi ring re- encoding , passes through the buffer. The control ler merges the frames i n the data streams A and B whi ch require re-encoding into a group when the start value is l arger than the end val ue. The decoding unit is connected el ectrically to the controller, and can decode the frames. The re-encoding unit is connected electrically to the controller and the decoding unit, and can re-encode the frames decoded by the decoding unit. The integrator is connected electrically to the re-encoding unit and the controller, and can integrate the re-encoded frames and the retained frames into the edited data stream C. When the controller determines that the start value is smaller than or equal to the end value, the controller will control the re-encoding unit such that, when the re-encoding unit is performing re-encoding, the buffer amount of the buffer can be maintained at the intermediate buffer value after the last re-encoded frame in the data stream A passes through the buffer, and the buffer amount after the last frame requiring re- encoding in the data stream B passes through the buffer is consistent with the end value. When the controller determines that the start value is larger than the end value, the controller will control the re-encoding unit to cause the re-encoding unit to re-encode the group into a group of pictures such that the buffer amount after the group of pictures has completely passed through the buffer is consistent with the end value. The effect of this invention resides in that only a small number of frames need to be re-encoded when two data streams are edited into a data stream so that occurrence of underflow when the edited data stream passes through the buffer can be prevented. Besides, the computational- speed can be increased, and the invention can be applied to data streams with a relatively small number of frames.
Brief Description of Drawings Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which: Figure 1 is a schematic diagram illustrating the situation that, when a decoder is decoding a group of pictures, a buffer in the decoder allocates buffer areas to the frames, respectively, with the input of the frames; Figures 2 is a schematic diagram illustrating the display order, the display order numbers, the processing order, and the processing order numbers of the frames in the group of pictures; Figure 3 is a system block diagram of a preferred embodiment of a method and apparatus for editing data streams according to this invention; Figure 4 is a flowchart of the method of the preferred embodiment; Figure 5 is a schematic diagram of the preferred embodiment, illustrating frames in a data stream A and a data stream B; and Figure 6 is a schematic diagram of the preferred embodiment, illustrating size of an intermediate buffer value.
Best Mode for Carrying Out the Invention As shown in Figure 3, an apparatus for editing data streams according to this invention includes a controller 1, a decoding unit 2, a re-encoding unit 3, and an integrator 4. In this embodiment, frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, are edited into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer (not shown). The first and second splicing points can be set by the user according to actual requirements. Moreover, in this embodiment, the data streams A and B, are in MPEG-2 compression format, and have the same group of pictures. However, this invention can also be used for data streams in other compression format, and the data streams A and B can have groups of pictures different from that of this embodiment. Besides, the groups of pictures composing the two data streams are not required to be the same. As shown in Figures 3 and 4, the method for editing data streams according to this invention includes the following steps: In step 81, the controller 1 determines the frames in the data streams A and B which need to be re-encoded, retained, or deleted according to the first and second splicing points. With reference to Figure 5, Figure 5 shows the display order, the display order numbers, the processing order, and the processing order numbers of the data streams A and B, respectively, and indicates the positions of the splicing points. The processing order of the group of pictures of each of the data streams A and B is IPBBPBBPBBPBBPBBPBBPBBPBB.... Moreover, the first splicing point is located between the frames in the data stream A which have display order numbers 17 and 18, whereas the second splicing point is located between the frames in the data stream B which have display order numbers 7 and 8. The controller 1 will delete the frames in the data stream A which have a display order number larger than or equal to 18, and will delete the frames in the data stream B which have a display order number smaller than or equal to 7. Herein, the controller 1 uses two rules to determine the frames that need to be re-encoded. The first rule is that a P or B frame cannot be the start frame of a data stream. The second rule is that the last frame of the data stream cannot refer to a frame after the splicing point. If a frame meets one of the aforesaid two conditions, the frame requires re-encoding. Therefore, based on these two rules, the controller 1 can determine that the frames in the data stream which require re- encoding are frames B, B which are shown in Figure 5 by hatching with oblique strokes, and the frames in the data stream B which require re-encoding are frames P and B which are shown in Figure 5 by hatching with oblique strokes. Apart from the frames that require re-encoding, the controller 1 will retain the frames that do not require re-encoding. Therefore, the processing order of the frames retained in the data stream A at this point is, in sequence, IPBBPBBPBBPBBPBBP, whereas the processing order of the frames retained in the data stream B is, in sequence, PBBPBBPBBPBBPBB.... Referring back to Figures 3 and 4, in step 82, the controller 1 determines the situation of the data streams passing respectively through the buffer prior to editing, and records a start value and an end value. The start value is the size of the buffer amount of the buffer after a frame preceding the first frame requiring re-encoding in the data stream A passes through the buffer, whereas the end value is the size of the buffer amount of the buffer after a frame in the data stream B which is at the same position as the last frame requiring re- encoding as determined in step 81 passes through the buffer. In step 83, the controller 1 determines whether the start value is smaller than the end value. If the start value is smaller than or equal to the end value, the flow proceeds to step 84. Otherwise, the flow skips to step 94. In step 84, the controller 1 sets an intermediate buffer value based on the sizes of the start value and the end value. The time to which the intermediate buffer value corresponds is between the times to which the start value and the end value correspond. In step 85, the decoding unit 2 decodes the frames in the data stream A which have been determined to require re- encoding. In step 86, the re-encoding unit 3 re-encodes the frames decoded in step 85. Moreover, the controller 1 will supply the intermediate buffer value to the re-encoding unit 3 to enable the re-encoding unit 3 to encode all of the frames in the data stream A which require re-encoding based on the intermediate buffer value such that, under the condition that the compression quality is not degraded, the buffer amount of the buffer after the last frame passes through the buffer could be maintained at the intermediate buffer value. With reference to Figure 6, when step 86 is executed for the first time, the re-encoding unit 3 converts frames B, B to frames P, B by re-encoding. To facilitate description, the frames in the front half of the data stream A and the frames in the rear half of the data stream B are omitted in Figure 6. When the intermediate buffer value is set to be relatively large, this represents that the buffer amount available for use by the frames in the data stream A which require re-encoding is small. Therefore, the picture quality of the frames requiring re- encoding will drop. However, a larger intermediate buffer value will cause the buffer amount to be closer to the largest buffer amount that can be accommodated by the buffer, and can therefore provide more buffer amount for use by the first I frame in the data stream B. This not only ensures that the buffer area will not have underflow, the start I frame in the data stream B can also have a sufficient buffer amount for use, thereby ensuring the picture quality of the data stream B. Thus, the controller 1 will set the size of the intermediate buffer value according to actual use conditions. In step 87, the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer can be maintained at the intermediate buffer value. In the affirmative, the flow skips to step 89. Otherwise, the flow proceeds to step 88. In this example, supposing the buffer amount after the last frame requiring re-encoding passes through the buffer cannot be maintained at the intermediate buffer value without affecting the compression quality, the flow proceeds to step 88. In step 88, the controller 1 increases the frames in the data stream A which require re-encoding so that the frames requiring re-encoding in the data stream A do not solely include the two frames B, B determined in step 81. Thus, the situation in which the compression quality is undesirably degraded to achieve the intermediate buffer value can be avoided. After completion of the execution of step 88, the flow skips back to step 85 to perform steps 85, 86, 87 and 88 in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the intermediate buffer value. In this example, the number of frames that the controller 1 finally needs to re-encode is 15. At this point, the buffer amount of the buffer can be maintained at the intermediate buffer value under the condition that the compression quality is not affected. Moreover, the processing order of the frames retained in the data stream A at this time is changed to IPB. In step 89, the decoding unit 2 decodes the frames in the data stream B which require re-encoding. In step 90, the re-encoding unit 3 re-encodes the decoded frames in the data stream B, and, under the condition that the compression quality is not degraded, the re-encoding unit 3 will attempt to bring the buffer amount after buffering of the last re- encoded frame into consistence with the end value. When step 90 is executed for the first time, the frames P, B in the data stream B which require re-encoding are re-encoded into frames
I, P. In step 91, the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In the affirmative, the flow skips to step 93. Otherwise, the flow proceeds to step 92. In this example, supposing the buffer amount after the last frame requiring re-encoding passes through the buffer cannot be maintained at the end value without affecting the compression quality, the flow proceeds to step 92. In step 92, the controller 1 increases the frames in the data stream B which require re-encoding so that the frames requiring re-encoding in the data stream B do not solely include the two P, B frames determined in step 81. In this way, the situation that the compression quality is degraded in order to achieve the end value can be avoided. After completion of the execution of step 92, the flow skips back to step 89, and steps 89, 90, 91 are carried out in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In this example, the buffer amount of the buffer can be maintained at the end value when the number of frames requiring re-encoding reaches 15. At this point, the processing order of the frames retained in the data stream B is, in sequence, PBB.... In step 93, the integrator 4 adds the retained frames to the re-encoded frames to transform the data stream A into a new data stream A', and the processing order of the data stream A' is IPBBPBBPBBPBBPBBPB. The data stream B is also transformed into a new data stream B', and the processing order of the data stream B' is, in sequence, IPPBBPBB.... The data stream B' is arranged after the data stream A' to obtain an edited data stream C. Thus, the processing order of the data stream C is IPBBPBBPBBPBBPBBPBIPPBBPBB.... In step 83, if the controller 1 determines that the start value is larger than the end value, the flow skips to step 94. In step 94, the controller 1 merges the frames in the data streams A and B which require re-encoding into a group. Therefore, when step 94 is executed for the first time, the frames B, B in the data stream A and the frames B, P in the data stream B are merged according to the processing order to form a group of frames BBPB. In step 95, the decoding unit 2 decodes the group obtained in step 94. In step 96, the re-encoding unit 3 re-encodes the frames decoded in step 95. Moreover, the re-encoding unit 3 will attempt to control the buffer amount after the group of frames has completely passed through the buffer to be the same as the end value under the condition that the compression quality is not degraded. When step 96 is executed for the first time, a group of frames IPBB will be obtained. In step 97, the controller 1 determines whether the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In the affirmative, the flow skips to step 99. Otherwise, the flow proceeds to step 98. In step 98, the controller 1 increases the frames requiring re-encoding so that the frames which require re-encoding do not include the four frames BBPB determined in step 94 only. After completion of the execution of step 98, the flow skips back to step 94, and steps 94, 95, 96, and 97 are carried out in sequence until the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value. In this example, by repeating the aforesaid steps, the frames retained in the data stream A are found to be IPBB, and the frames retained in the data stream B are found to be PBB.... In step 99, the integrator 4 integrates the retained frames and the re-encoded frames into a new data stream D, in which the front half portion of the frames according to the processing order of the data stream D are the frames IPBB retained in the data stream A, whereas the frames in the rear half portion are the frames PBB... retained in the data stream B. The frames between the front half portion and the rear half portion are the re-encoded group of pictures IPBBPBBPBBPBB... PB. The processing order of the edited data stream D is IPBB IPBBPBBPBBPBB... PBPBB.... However, it is noted that, although two rules are used to determine the frames that require re-encoding in step 81 of this embodiment, and frames requiring re-encoding are increased dynamically in step 88 or step 92 when the number of frames requiring re-encoding is not sufficient and the compression quality is degraded, in utilizing this invention, frames requiring re-encoding may be increased in step 81 according to experience or actual use conditions so that the frames requiring re-encoding do not merely include the frames determined based on the two rules. For example, by setting the number of frames requiring re-encoding to 15, repetitions of step 88 or step 92 can be reduced or avoided, thereby increasing the overall computational speed. For the same reason, the number of frames requiring re-encoding may also be increased in step 94 to reduce the number of times of repeating step 98. In addition, although this embodiment is used to edit two data streams A and B, it can also be used when there is only one data stream. That is, when there is only one data stream, and the data stream has two splicing points at different positions, the frames between the two splicing points are deleted, and the remaining data stream segments preceding and following the splicing points are edited so as to merge the segments into a new data stream. In sum, this invention can edit two data streams A and B into a data stream, and can eliminate the problem of underflow when the edited data stream passes through the buffer. The essential technical feature resides in that the controller 1 initially determines the situations when the data streams A and B pass respectively through the buffer prior to editing, and records a start value and an end value. The re-encoding unit 3 re-encodes some of the frames properly so that the buffer amount required for buffering the new data stream C or D, for which editing has been completed, through the buffer is consistent with the start value and the end value under the condition that the frames are identical so as to prevent buffer underflow. Since the number of frames requiring re-encoding is considerably reduced in this invention compared with the method adopted in the prior art, regardless of whether the flow from steps 81 to 93 or the flow from steps 81 to 83 and from steps 94 to 99 is followed, this invention not only provides a faster computational speed compared with the prior art, it can also be used to edit data streams with a relatively small nu mber of frames. Furthermore, as this invention can dynamical ly i ncrease the frames requiri ng re-encoding , better compression quality can be ensu red . Thus , the objects of thi s invention can be positively achieved . While the present invention has been described i n connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifi cations and equivalent arrangements.

Claims

1. A method for editing data streams adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer, the method comprising the following steps: (1) based on positions of the first and second splicing points, determining the frames in the data streams A and B which require re-encoding and the frames which need to be retained therein, and recording an end value, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer; (2) setting an intermediate buffer value; (3) decoding the frames in the data streams A and B which require re-encoding, respectively; (4) re-encoding the frames decoded from the data stream A in step (3), such that the buffer amount of the buffer can be maintained at the intermediate buffer value after the last re-encoded frame passes through the buffer; (5) re-encoding the frames decoded from the data stream B in step (3), such that the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value; and (6) adding the retained frames to the re-encoded frames obtained in steps (4) and (5) to yield the edited data stream C.
2. The method for editing data streams as claimed in Claim 1, wherein, if a start frame in the data stream B after the second splicing point is a P (Predictive-coded Picture) or B (Bi- directionally Predictive-coded) frame, the start frame requires re-encoding.
3. The method for editing data streams as claimed in Claim 1, wherein, if a frame in the data stream A refers to a frame after the first splicing point, the frame in the data stream A requires re-encoding.
4. The method for editing data streams as claimed in Claim 1, wherein, in step (6), the frames in the data stream A which are retained in step (1) are added to the re-encoded frames obtained in step (4) to yield a new data stream A', and the frames in the data stream B which are retained in step (1) are added to the re-encoded frames obtained in step (5) to yield a new data stream B', the data stream B' being arranged after the data stream A' to obtain the edited data stream C.
5. The method for editing data streams as claimed in Claim 1, wherein, in the event of degradation of compression quality after execution of step (4), frames in the data stream A requiring re-encoding are increased, and steps (3) and (4) are repeated until the buffer amount of the buffer can be maintained at the intermediate buffer value under the condition that the compression quality is not degraded.
6. The method for editing data streams according to Claim 1, wherein, in the event of degradation of compression quality after execution of step (5), frames in the data stream B which require re-encoding are increased, and steps (3) and (5) are repeated unti l the buffer amount of the buffer can be maintained at the end value under the condition that the compression qual ity is not degraded .
7. An apparatus for editing data streams adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B whi ch are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer, said apparatus for editing data streams comprisi ng : a controller that determines the frames in the data streams A and B which require re-encodi ng and the frames which need to be retained therein based on positions of the first and second splicing points , that sets an i ntermediate buffer value, and that records an end value, the end value being size of a buffer amount of the buffer after a frame, wh ich is at the same position as the last frame requiring re-encoding in the data strea m B prior to editing of the data stream B , passes through the buffer; a decoding unit connected electrically to said controller for decoding the frames i n the data strea ms A and B which require re-encoding ; a re-encoding unit connected electrical ly to said controller and said decoding unit for re-encoding the frames decoded by said decoding unit such that the buffer amount of the buffer can be maintained at the intermediate buffer value after the l ast re-encoded frame in the data stream A passes through the buffer, and such that the buffer amount after the last frame in the data stream B requiring re-encoding passes through the buffer is consistent with the end value; and an integrator connected electrically to said re-encoding unit and said controller for integrating the re-encoded frames and the retained frames into the edited data stream C.
8. The apparatus for editing data streams as claimed in Claim 7, wherein, if a start frame in the data stream B after the second splicing point is a P or B frame, said controller determines that the start frame requires re-encoding.
9. The apparatus for editing data streams as claimed in Claim 7, wherein, if a frame in the data stream A refers to a frame after the first splicing point, said controller determines that said frame in the data stream A requires re-encoding.
10. The apparatus for editing data streams as claimed in Claim 7, wherein said integrator adds the frames retained in the data stream A to the re-encoded frames in the data stream A to yield a new data stream A', and adds the frames retained in the data stream B to the re-encoded frames in the data stream B to yield a new data stream B', the data stream B' being arranged after the data stream A' to obtain the edited data stream C.
11. The apparatus for editing data streams as claimed in Claim 7, wherein, in the event of degradation of compression quality, said controller dynamically increases the frames requiring encoding in the data stream A.
12. The apparatus for editing data streams as claimed in Claim 7, wherein, in the event of degradation of compression quality, said controller dynamically increases the frames requiring encoding in the data stream B.
13. A method for editing data streams adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer, the method comprising the following steps: (1) based on positions of the first and second splicing points, determining the frames in the data streams A and B which require re-encoding and the frames which need to be retained therein, and recording an end value and a start value, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer, the start value being size of the buffer amount of the buffer a frame, which precedes the first frame in the data stream A that requires re-encoding, passes through the buffer; (2) determining whether the start value is smaller than the end value, and executing steps (3), (4), (5), (6), and (7) in sequence if the start value is smaller than or equal to the end value, and otherwise executing steps (8), (9), (10), and (11) if the start value is larger than the end value; (3) setting an intermediate buffer value; (4) decoding the frames in the data stream A and the data stream B which require re-encoding, respectively; (5) re-encoding the frames decoded from the data stream A such that the buffer amount of the buffer can be maintained at the intermediate buffer value after the last re- encoded frame passes through the buffer; (6) re-encoding the frames decoded from the data stream B such that the buffer amount after the last frame requiring re-encoding passes through the buffer is consistent with the end value; (7) adding the retained frames to the re-encoded frames obtained in steps (5) and (6) to yield the edited data stream C; (8) merging the frames requiring re-encoding in the data streams A and B into a group; (9) decoding the group; (10) re-encoding the group into a group of pictures such that the buffer amount after the group of pictures has completely passed through the buffer is consistent with the end value; and (11) adding the frames retained in step (1) to the group of pictures that was re-encoded in step (10) to form the edited data stream C.
14. The method for editing data streams as claimed in Claim 13, wherein, if a start frame in the data stream B after the second splicing point is a P or B frame, the start frame requires re-encoding.
15. The method for editing data streams as claimed in Claim 13, wherein, if a frame in the data stream A refers to a frame after the first splicing point, the frame in the data stream A requires re-encoding.
16. The method for editing data streams as claimed in Claim 13, wherein, in step (7), the frames of the data stream A which are retained in step (1) are added to the re-encoded frames obtained in step (5) so as to obtain a new data stream A', and the frames of the data stream B which are retained in step (1) are added to the re-encoded frames obtained in step (6) so as to obtain a new data stream B',' the data stream B' being arranged after the data stream A' so as to obtain the edited data stream C.
17. The method for editing data streams as claimed in Claim 13, wherein, in step (11), the re-encoded group of pictures is arranged after the frames retained in the data stream A in sequence, and the frames retained in the data stream B are arranged after the group of pictures in sequence.
18. The method for editing data streams as claimed in Claim 13, wherein, in the event of degradation of compression quality after execution of step (5), frames requiring re-encoding in the data stream A are increased, and steps (4) and (5) are repeated until the buffer amount of the buffer can be maintained at the intermediate buffer value under the condition that the compression quality is not degraded.
19. The method for editing data streams as claimed in Claim 13, wherein, in the event of degradation of compression quality after execution of step (6), the frames requiring re-encoding in the data stream B are increased, and steps (4) and (6) are repeated until the buffer amount of the buffer can be maintained at the end value under the condition that the compression quality is not degraded.
20. The method for editing data streams as claimed in Claim 13, wherein, in the event of degradation of compression quality after execution of step (10), the frames requiring re-encoding are increased, and steps (8), (9), and (10) are repeated until the buffer amount of the buffer can be maintained at the end value under the condition that the compression quality is not degraded.
21. An apparatus for editing data streams adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer, said apparatus for editing data streams comprising: a controller which determines the frames in the data streams A and B that require re-encoding and that need to be retained based on positions of the first and second splicing points, which sets an intermediate buffer value, which records an end value and a start value, and which compares sizes of the start value and the end value so as to generate corresponding actions, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer, the start value being the size of a buffer amount of the buffer after a frame, which precedes the first frame in the data stream A requiring re-encoding, passes through the buffer, said controller merging the frames in the data streams A and B which require re-encoding into a group when the start value is larger than the end value; a decoding unit connected electrically to said controller for decodi ng the frames; a re-encoding unit connected electrical ly to said controller and said decoding unit for re-encoding the frames decoded by said decoding unit; and an integrator connected electrical ly to said re-encoding unit and said control ler for integrating the re-encoded frames and the retained frames into the edited data stream C; wherein , when said controller determines that the start val ue is smal ler than or equal to the end val ue, sai d control ler will control said re-encoding unit such that, when the re- encoding unit is performing re-encoding, the buffer amount of the buffer can be mai ntained at the i ntermediate buffer value after the l ast re-encoded frame i n the data stream A passes through the buffer, and the buffer amount after the last frame requiring re-encoding in the data stream B passes through the buffer i s consistent with the end value, and wherein , when said control ler determ ines that the start val ue is larger than the end value, said controller will control said re-encoding unit to cause said re-encoding u nit to re-encode the group into a group of pictures such that the buffer amount after the g roup of pictures has co mpletely passed through the buffer is consi stent with the end value.
22. The apparatus for editi ng data streams as clai med in C lai m 21 , wherein , if a start frame in the data stream B after the second splicing point is a P or B frame, said controller will determi ne that the start frame requires re-encoding.
23. The apparatus for editing data streams as claimed in Claim 21, wherein, if a frame in the data stream A refers to a frame after the first splicing point, said controller will determine that said frame in the data stream A requires re- encoding.
24. The apparatus for editing data streams as claimed in Claim 21, wherein, when the start value is smaller than or equal to the end value, said integrator will add the frames retained in the data stream A to the re-encoded frames in the data stream A to obtain a new data stream A', and will add the frames retained in the data stream B to the re-encoded frames in the data stream B to obtain a new data stream B', the data stream B' being arranged after the data stream A' to obtain the edited data stream C.
25. The apparatus for editing data streams as claimed in Claim 21, wherein, when the start value is larger than the end value, said integrator will arrange the re-encoded group of pictures after the frames retained in the data stream A in sequence, and will arrange the frames retained in the data stream B after the group of pictures in sequence.
26. The apparatus for editing data streams as claimed in Claim 21, wherein, in the event of degradation of compression quality, said controller will dynamically increase the frames requiring re-encoding in the data stream A.
27. The apparatus for editing data streams as claimed in Claim 21, wherein, in the event of degradation of compression quality, said controller will dynamically increase the frames requiring re-encoding in the data stream B.
28. The apparatus for editing data streams as claimed in Claim 21, wherein, in the event of degradation of compression quality, said controller will dynamically increase the frames requiring re-encoding in the data streams A and B.
29. A method for editing data streams adapted to edit frames in a data stream A which are located before a first splicing point, and frames in a data stream B which are located after a second splicing point, into a data stream C such that underflow will not occur when the edited data stream C passes through a buffer, said method comprising the following steps: (1) based on positions of the first and second splicing points, determining the frames in the data streams A and B which require re-encoding and the frames which need to be retained therein, and recording an end value, the end value being size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requiring re-encoding in the data stream B prior to editing of the data stream B, passes through the buffer; (2) merging the frames in the data streams A and B which require re-encoding into a group; (3) decoding the group; (4) re-encoding the group into a group of pictures such that the buffer amount after the group of pictures has completely passed through the buffer is consistent with the end value; and (5) adding the frames retained in step (1) to the re- encoded group of pictures to form the edited data stream C.
30. The method for editing data streams as claimed in Claim 29, wherein, if a start frame of the data stream B after the second splicing point is a P or B frame, the frame requires re- encoding .
31 . The method for editing data streams as claimed in Claim 29 , wherei n, if a frame i n the data stream A refers to a frame after the first splicing point, the frame in the data stream A requires re-encoding .
32. The method for editing data streams as clai med in Cl ai m 29, wherein, in step (5), the re-encoded group of pictures is arranged i n sequence after the frames retained in the data stream A, and the frames retained in the data stream B are arranged in sequence after the group of pictures.
33. The method for editing data streams as claimed in Claim 29, wherein, in the event of degradation of compression quality after execution of step (4) , frames requiri ng re-encodi ng are increased, and steps (2), (3), and (4) are repeated until the buffer amount of the buffer can be maintained at the end value under the condition that the compression quality is not degraded .
34. An apparatus for editi ng data streams adapted to edit frames in a data stream A which are located before a first spl icing poi nt, and frames i n a data stream B whi ch are located after a second splicing point, into a data stream C such that underflow wi l l not occur when the edited data stream C passes through a buffer, said apparatus for editi ng data streams co mprising : a control ler which determines the frames i n the data streams A and B that require re-encoding and the frames that need to be retained therein based on positions of the first and second splicing points, and which merge the frames requiring re-encoding in the data streams A and B i nto a group, said control ler recording an end value, the end val ue bei ng size of a buffer amount of the buffer after a frame, which is at the same position as the last frame requi ring re-encodi ng in the data stream B prior to editing of the data stream B , passes through the buffer; a decodi ng unit connected electrical ly to said control ler for decodi ng the group; a re-encoding unit connected electrically to said controller and said decoding unit for re-encoding the group into a group of pi ctu res such that the buffer amount after the group of pictures has completely passed th rough the buffer is consistent with the end val ue; and an integrator connected electrically to said re-encoding unit and said controller for integrating the re-encoded group of pictures and the retai ned frames into the edited data stream C .
35. The apparatus for editi ng data streams as clai med in Clai m 34, wherein, if a start frame in the data stream B after the second splicing point is a P or B frame, said controller will determine that the start frame requires re-encoding .
36. The apparatus for editing data streams as clai med in Cl ai m 34, wherei n, if a frame in the data stream A refers to a frame after the first splicing point, said controller will determine that said frame in the data stream A requires re-encoding.
37. The apparatus for editi ng data streams as clai med in Clai m 34, wherein sai d i ntegrator arranges the re-encoded group of pictures after the frames retained in the data stream A in sequence, and arranges the frames retained in the data stream B after the group of pictures in sequence.
38. The apparatus for editing data streams as claimed in Claim 34, wherein, in the event of degradation of compression quality, said controller will dynamically increase the frames requiring re-encoding until the buffer amount of the buffer can be maintained at the end value under the condition that the compression quality is not degraded.
PCT/JP2005/011182 2004-06-14 2005-06-13 Method and apparatus for editing data streams WO2005122585A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200410059243.9 2004-06-14
CN 200410059243 CN1713727B (en) 2004-06-14 2004-06-14 Method and device for editing data stream

Publications (1)

Publication Number Publication Date
WO2005122585A1 true WO2005122585A1 (en) 2005-12-22

Family

ID=34970333

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2005/011182 WO2005122585A1 (en) 2004-06-14 2005-06-13 Method and apparatus for editing data streams

Country Status (2)

Country Link
CN (1) CN1713727B (en)
WO (1) WO2005122585A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016020929A1 (en) * 2014-08-08 2016-02-11 Hewlett-Packard Development Company, L.P. Truncation point selection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999005870A2 (en) * 1997-07-22 1999-02-04 Koninklijke Philips Electronics N.V. Method of switching between video sequences and corresponding device
EP1079631A1 (en) * 1999-08-26 2001-02-28 Sony United Kingdom Limited Switching between bit-rate reduced signals
EP1098526A2 (en) * 1999-11-02 2001-05-09 Matsushita Electric Industrial Co., Ltd. Video editing apparatus and method
US20030067989A1 (en) * 1997-07-25 2003-04-10 Sony Corporation System method and apparatus for seamlessly splicing data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10285529A (en) * 1997-04-04 1998-10-23 Sony Corp Image editing device and image editing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999005870A2 (en) * 1997-07-22 1999-02-04 Koninklijke Philips Electronics N.V. Method of switching between video sequences and corresponding device
US20030067989A1 (en) * 1997-07-25 2003-04-10 Sony Corporation System method and apparatus for seamlessly splicing data
EP1079631A1 (en) * 1999-08-26 2001-02-28 Sony United Kingdom Limited Switching between bit-rate reduced signals
EP1098526A2 (en) * 1999-11-02 2001-05-09 Matsushita Electric Industrial Co., Ltd. Video editing apparatus and method

Also Published As

Publication number Publication date
CN1713727B (en) 2010-11-10
CN1713727A (en) 2005-12-28

Similar Documents

Publication Publication Date Title
US6301428B1 (en) Compressed video editor with transition buffer matcher
KR100343352B1 (en) Two-pass encoding method of digital motion video sequences for constant-or variable bit rate
KR100545145B1 (en) Method and apparatus for reducing breathing artifacts in compressed video
EP0982948B1 (en) MPEG stream switching process for open GOPs
US8374236B2 (en) Method and apparatus for improving the average image refresh rate in a compressed video bitstream
EP1005232A2 (en) Rate control for an MPEG transcoder without a priori knowledge of picture type
EP1445773A1 (en) Encoding device and encoding method
US20060239563A1 (en) Method and device for compressed domain video editing
US7835436B2 (en) Video-encoding device and video-encoding control method
US20120262598A1 (en) Image signal processing apparatus
JP4223567B2 (en) Coded video sequence switching method and apparatus
JP2008306705A (en) Bitrate control method and apparatus for video sequence encoding by using only intra picture
EP1004207A1 (en) Method of switching of coded video sequences and corresponding device
US6314139B1 (en) Method of inserting editable point and encoder apparatus applying the same
US20060104350A1 (en) Multimedia encoder
JPH10285529A (en) Image editing device and image editing method
US6993080B2 (en) Signal processing
US20050078756A1 (en) Encoding apparatus and encoding method
US20040161034A1 (en) Method and apparatus for perceptual model based video compression
WO2005122585A1 (en) Method and apparatus for editing data streams
JPH08251582A (en) Encoded data editing device
JPH10304311A (en) Video coder and video decoder
JP4399794B2 (en) Image coding apparatus and image coding method
JP2002034039A (en) Method and device for encoding image signal
Pan et al. Content adaptive frame skipping for low bit rate video coding

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KM KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NG NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SM SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LT LU MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2006552384

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

WWW Wipo information: withdrawn in national office

Country of ref document: DE

122 Ep: pct application non-entry in european phase