Coding apparatus and method

Abstract: A technique for coding input picture data comprises adaptively changing the number (N) of unitary frames, which constitute a group of pictures (GOP), in conformity with the frame rate of the input picture data, thereby forming picture data of a predetermined unitary time in a predetermined unit of GOPs.

Description: This invention relates to the coding of input picture data. As one of the techniques adopted for coding picture data with compression, there is known the MPEG (Moving Picture Experts Group) system. According to this MPEG system, one sequence of moving pictures is coded through division into GOPs (Groups Of Pictures) each composed of a plurality of frames. Each GOP consists of at least one intra-frame coded picture (I-picture) inserted in the GOP, an inter-frame coded picture (P-picture) predicted from a temporally preceding frame already coded, and an inter-frame coded picture (B-picture) predicted from two temporally preceding and following frames. Normally, in the MPEG system, the number of frames constituting one GOP is not prescribed in particular. However, generally in the television standard of 525/60 (scanning lines/field frequency, 525 lines/60 Hz, NTSC) system, the number N of frames constituting one GOP is set to 15, and the appearance period M of an I-picture or a P-picture is set to 3. More specifically, two B-pictures are inserted between an I-picture and a P-picture, and a total of 15 pictures are grouped to form a GOP. Consequently, random access to picture data is rendered possible since the picture data including an I-picture are thus processed in a unit of a GOP. Meanwhile in the other television standard of 625/50 (scanning lines/field frequency, 625 lines/50 Hz, PAL or SECAM) system, the number of frames constituting one GOP is set to 12. In case the input picture data before being coded with picture compression are formed in a unit of seconds, convenience is attainable if the data coded with picture compression can be managed in a unit of seconds as well. For example, in a commercial film where one sequence of moving pictures is divided in a unit of seconds such as 15 or 30 seconds, the compression-coded picture data also need to be temporally managed in a unit of seconds. In the 525/60 system for example where picture data are transmitted at a rate of 30 frames per second, pictures corresponding to one second can be formed exactly in two GOPs each composed of 15 frames, as illustrated in Fig. 1. Consequently it becomes possible to perform picture editing or random access with facility by processing the picture data in a unit of GOPs. Meanwhile in the 625/50 system, 25 frames are required to form pictures of one second, since picture data are transmitted at a rate of 25 frames per second. However, as illustrated in Fig. 2, merely 24 frames are obtained in two GOPs, so that it is impossible to form required pictures corresponding exactly to one second in a unit of GOPs. In such a case, it has been customary heretofore to adopt a technique of constituting each GOP by 12 frames and balancing the figures temporally in the last GOP where the number of frames is less than 12. In adopting this technique, however, there exists a problem that considerable differences are prone to occur in the quantities of generated data among GOPs. Adequate measures for solving the above problems may be achieved by setting the frame number per GOP to, e.g., 25 in the 625/50 system. But if the frame number per GOP is excessively increased, it causes another problem that the unit of random access is rendered immoderately larger. Furthermore, taking into account the quantity of generated data in a unit of GOPs, there arises a problem that the result attained is quite different from the 525/60 system. Respective aspects of the invention are set forth in claims 1 and 3 hereof, relating to a coding apparatus and a coding method respectively. According to the invention there is provided a coding apparatus (and method) which is so contrived as to adaptively change the number of frames which constitute a GOP, in conformity with the frame rate of input picture data, thereby forming pictures of a predetermined time period in a predetermined number of GOPs. Such a coding apparatus (and method) is capable of temporally managing, in a predetermined unit time, picture data coded in a unit of GOPs each composed of a plurality of frames. A preferred form of implementation of the invention described hereinbelow provides an apparatus and method applicable to, for example, a case of coding input picture data by dividing one sequence of moving pictures into groups each of which is composed of a plurality of frames. The invention will now be further described, by way of illustrative and non-limiting example, with reference to the accompanying drawings, in which: Fig. 1 is a schematic diagram for explaining how pictures of one second are formed of 15 frames in each GOP according to the prior art; Fig. 2 is a schematic diagram for explaining how pictures of one second are formed of 12 frames in each GOP according to the prior art; Fig. 3 is a block diagram showing an embodiment of the coding apparatus of the present invention; Fig. 4 is a block diagram showing an exemplary constitution of a frame processor employed in the coding apparatus of Fig. 1; Fig. 5 schematically illustrates three picture types used in the MPEG system; Fig. 6 is a schematic diagram for explaining how the number of frames in one GOP is changed alternately to 12 and 13 in the coding apparatus of Fig. 1; Fig. 7 is a schematic diagram for explaining how picture types are rearranged when the number of frames in one GOP is changed alternately to 12 and 13 in the coding apparatus of Fig. 1; Fig. 8 is a schematic diagram for explaining how picture types are rearranged when one GOP is composed of 15 frames; Fig. 9 is a schematic.diagram for explaining how picture types are rearranged when one GOP is composed of 12 frames; Fig. 10 is a flow chart for explaining a procedure to set picture types in the coding apparatus of Fig. 1; Fig. 11 is another flow chart for explaining the procedure to set picture types in the coding apparatus of Fig. 1; and Fig.12 is a further flow chart for explaining the procedure to set picture types in the coding apparatus of Fig. 1. Hereinafter a preferred embodiment of the present invention will be described in detail with reference to the accompanying drawings. In Fig. 3, reference numeral 1 denotes a coding apparatus as a whole. When picture data are inputted to a frame processor 2, the picture data are rearranged under control of a CPU 3, and then a header and a picture type of a GOP are supplied in this order to a codec 4 in the following stage. Subsequently the codec 4 processes the picture data through DCT (discrete cosine transform), quantization and variable-length coding, and then outputs processed picture data S 20 therefrom. As shown in Fig. 4, the picture data inputted to the frame processor 2 are once stored in a frame memory 5. Meanwhile to a picture type generator 6, there are supplied, together with clock pulses synchronized with the frames, an appearance period M of an I- or P-picture, the number N of frames in a GOP, and a flag SPF which instructs an operation of changing the number of frames in a GOP. The picture type generator 6 generates a control signal CT for controlling instruction of rearrangement of the picture data in accordance with predictive coding on the basis of such appearance period M, frame number N and flag SPF, and then sends the control signal CT to a rearrange circuit 7. The rearrange circuit 7 reads out the picture data in a unit of frame from the frame memory 5 in response to the control signal CT and, after rearranging the frames in accordance with the MPEG coding system, outputs the rearranged data successively. At this time, the picture type generator 6 generates a GOP header GOPH and a picture type on the basis of a picture type generation algorithm. Consequently the rearranged picture data S 2 are supplied, next to the header GOPH, to the following-stage codec 4 in synchronism with the picture type. In the MPEG system, one sequence of moving pictures is divided into GOPs each composed of a plurality of frames. As illustrated in Fig. 5, each GOP is composed of at least one intra-frame coded picture (I-picture) inserted therein, an inter-frame coded picture (P-picture) predicted from a temporally preceding frame already coded, and an inter-frame coded picture (B-picture) predicted from two temporally preceding and following frames. When the picture data are those based on the 625/50 system where a data transmission rate is 25 frames per second, it follows that 25 frames are required for obtaining picture data of one second. Then the frame processor 2 changes the frame number N of GOPs to 12 and 13 alternately and dynamically in response to a control signal CT during the frame reading mode. Consequently, as illustrated in Fig. 6, picture data of one second can be obtained exactly in two GOPs where picture data of 25 frames are formed. The individual picture types of the frames are thus rearranged by the rearrange circuit 7 as shown in Fig. 7 and then are supplied to the codec 4. In case the frame number N is 13, since the last frame in the GOP needs to be a P-picture as prescribed in the standard, a P-picture is added as the last frame. Meanwhile, when the picture data S 1 are those based on the 525/60 system where a data transmission rate is 30 frames per second, the frame number N is set to 15 as in the conventional case, and the frames in each GOP are rearranged as shown in Fig. 8 and then are sent to the codec 4, whereby pictures corresponding to one second are formed of two GOPs in the 525/60 system. Thus, it becomes possible to access the coded picture data of GOPs in a unit of second. Further, when the frame number N is set to 12 as in the conventional case in the 625/50 system, the individual picture types of the frames are rearranged as shown in Fig. 9 and then are sent to the codec 4, where the frame number N, the appearance period M and the flag SPF are set in advance by a program or the like in conformity with the transmission rate of the input picture data S 1 . Practically, changing the picture types of the frames of GOPs that constitute one sequence of moving pictures is executed according to picture type generation procedures shown in Figs. 10 to 12. More specifically, a picture type setting procedure is started at step SP1, and then a down-counter N CNT is set to N-1 at step SP2 on the basis of the frame number N preset by a program or the like with respect to the input picture data S 1 . Similarly, a down-counter M CNT is set to M-1 on the basis of the appearance period M of I- or P-pictures. When the down-counter N CNT is not 0 at step SP3, i.e., when the frame is not the last one in the GOP, the operation proceeds to step S10. A decision is made at step S10 as to whether the down-counter M CNT is 0 or not, and when the result of this decision signifies that its value is 0, the operation proceeds to step SP11. Then a decision is made at step SP11 as to whether a flag GOPS for outputting a GOPH (GOP header) is set or not, and if the result of this decision is affirmative, the operation proceeds to step SP12, where an I-picture is outputted while the flag GOPS is reset. Subsequently at step SP13, the down-counter M CNT for M is set to M-1. Then the down-counter N CNT is decremented at step SP14, and thereafter the operation returns to step SP3. When the result of the decision at step SP10 signifies that the value in the down-counter M CNT is not 0, the operation proceeds to step SP15, where a B-picture is outputted. And subsequently at step SP16, the down-counter M CNT is decremented. Meanwhile, if the result of the decision at step SP11 signifies that the flag GOPS is reset, the operation proceeds to step SP17 to output a P-picture and then proceeds to step SP13. If the result of the decision at step SP3 signifies that the value in the down-counter N CNT is 0, the operation proceeds to step SP4, where a P-picture is outputted while the flag GOPS is set, and the down-counter M CNT is set to M. Subsequently at step SP5, a decision is made as to whether a flag SPF for changing the preset frame number is set or not. And if the result of this decision signifies that the flag SPF is reset, the operation proceeds to step SP6 to set the down-counter N CNT to N-1 and then returns to step SP3 again. Meanwhile, if the result of the above decision signifies that the flag SPF is set, the operation proceeds to step SP7, where a decision is made as to whether there is set or not a flag DMF of a toggle switch for changing the frame number N of one GOP to 12 or 13. If the result of the above decision signifies that the flag DMF is set, the operation proceeds to step SP8, where the flag DMF is reset while the down-counter M CNT is set to 11, and then the operation returns to step SP3. In case the result signifies that the flag DMF is reset, the operation proceeds to step SP9, where the flag DMF is set while the down-counter N CNT is set to 12. And subsequently the operation returns to step SP3. Thereafter, until completion of one sequence of moving pictures, the above processing is executed repeatedly in respect of each frame of the picture data in accordance with the picture type setting procedure. When the picture data S 1 are inputted to the coding apparatus 1 in the construction mentioned above, first the data are once stored per frame in the frame memory 5 of the frame processor 2. And the frames outputted therefrom to the rearrange circuit 7 are rearranged in response to a control signal CT, and the rearranged frames are supplied to the following-stage codec 4 in synchronism with the picture types. The picture types are outputted from the picture type generator 6 on the basis of the frame number N, the appearance period M and the flag SPF preset by the CPU 3. The picture type generator 6 outputs picture types successively in such a manner as to form GOPs, each of which is composed of a predetermined number of frames conforming to the transmission system of the input picture data S 1 , in accordance with the picture type generation procedure on the basis of the frame number N, the appearance period M and the flag SPF. More specifically, when the CPU 3 has judged that the input picture data S 1 are those based on the 625/50 system, the CPU 3 sets the appearance period M, the frame number N and the flag SPF in the frame processor 2 in such a manner that the frame number N is changed to 12 and 13 alternately in a unit of GOP during the picture data reading mode. As a result, the frames are read out as shown in Fig. 7 and are rearranged to form GOPs. The number of the frames thus rearranged amounts to 25 in two GOPs, so that in the 625/50 system where the data transmission rate is 25 frames per second, there are formed pictures corresponding exactly to one second, whereby it is rendered possible to manage the coded picture data in a unit of second with two GOPs constituted as a minimum unit. The decision of the CPU 3 as to whether the input picture data S 1 are those based on the 625/50 system or not is made in accordance with the frame frequency of the input picture data S 1 or with the input from the operator. Meanwhile, in case the input picture data S 1 are those based on the 525/60 system, the frame number N is set to 15, and the appearance period M to, e.g., 3 respectively. As a result, the frames read out as shown in Fig. 8 are rearranged in a manner to form GOPs and then are supplied to the codec 4. When there exists no necessity of temporal management in a unit: of second in the 625/50 system, the frame number N is set fixedly to 12 as in the conventional manner, and the frames read out are rearranged as shown in Fig. 8 and then are supplied to the codec 4. The frames of the picture data S 2 thus rearranged in the frame processor 2 are sent to the codec 4 in a unit of GOPs synchronously with the picture types while a header GOPH is included as a top signal in each GOP. And the coded picture data S 20 are outputted from the codec 4. According to the construction described above, when the input picture data S 1 are read in, the number N of frames constituting one GOP is set in conformity with the transmission rate of the input picture data S 1 . For example, the number N is set to 15 in the 525/60 system where the data transmission rate is 30 frames per second. Meanwhile in the 625/50 system where the data transmission rate is 25 frames per second, the number N of frames constituting one GOP is changed to 12 and 13 alternately and dynamically, whereby picture data of one second are formed exactly of two GOPs, so that it becomes possible to manage the coded picture data of GOPs in a unit of second. Further according to the embodiment mentioned, even in nonlinear editing where picture data stored in a frame memory or the like are processed by the use of a computer, the data can be managed in a unit of second by processing the frames in a unit of GOPs. It is to be understood that the description relative to the above embodiment is concerned merely with an exemplary case of alternately changing the number of frames in a GOP to 12 and 13 in conformity with the transmission rate of 25 frames per second of the input picture data S 1 . However, the present invention is not limited to such an example alone, and the changeable number of frames may be set to other arbitrary values of, e.g., 11 and 14. According to the embodiment described hereinabove, the number of frames in GOPs each composed of a plurality of frames is adaptively changed in conformity with the transmission rate of input picture data to consequently form pictures of a predetermined unitary time in a predetermined unit of GOPs, hence realizing an improved coding apparatus and method suited to manage the coded picture data in a predetermined unitary time. Although the present invention has been described hereinabove with reference to some preferred embodiments thereof, it is to be understood that the invention is not limited to such embodiments alone, and a variety of other modifications and variations will be apparent to those skilled in the art without departing from the scope of the invention. The scope of the invention, therefore, is to be determined solely by the appended claims.

Claims: An apparatus for coding input picture data having a frame rate of input picture frames which produces a predetermined integer number of frames in a predetermined time period, said apparatus comprising: a control means (3, 5, 6) for setting the number of frames of each of a plurality of Groups of Pictures (GOP) into which said input picture frames are divided, each of said Groups of Pictures (GOP) having at least one picture frame designated as an intra-frame coded picture (I), and at least one picture frame designated as an inter-frame coded picture (P, B); a rearranging means (7) for rearranging the order of the input picture frames (I, P, B) in each of said Groups of Pictures (GOP) into a predetermined order; and a coding means for coding said input picture frames of each Group of Pictures (GOP) rearranged by said rearranging means, characterised in that said control means (3, 6) operates to adaptively change the numbers of picture frames of each of said Groups of Pictures (GOP) in conformity with said frame rate of input picture frames, such that each Group of Pictures (GOP) comprises an integer number of frames, and such that the number of frames in a plurality of Groups of Pictures (GOP) together equals said predetermined integer. The apparatus according to claim 1, wherein said control means sets the numbers of frames in said Groups of Pictures (GOP) in such a manner that said number is changed alternately to 12 and 13 with regard to said picture data inputted at a rate of 25 frames per second. A method of coding input picture data having a frame rate of input picture frames which produces a predetermined integer number of frames in a predetermined time period, said method comprising the steps of: setting the number of frames of each of a plurality of Groups of Pictures (GOP) in to which said input picture frames are divided, each of said Groups of Pictures (GOP) having at least one picture frame designated as an intra-frame coded picture (I), and at least one picture frame designated as an inter-frame coded picture (P, B); rearranging the order of the input picture frames (I, P, B,) in each of said Groups of Pictures (GOP) into a predetermined order; and coding the rearranged input picture frames (I, B, P), characterised in that the step of setting the number of frames comprises adaptively changing said number of picture frames of each of said Group of Pictures (GOP) in conformity with the frame rate of said input picture frames, such that each Group of Pictures (GOP) comprises an integer number of frames, and such that the number of frames in a plurality of Groups of Pictures (GOP) together equals said predetermined integer.

Inventors: TAKANO SHUNSUKE, TAKANO, SHUNSUKE, Takano, Shunsuke, c/o Sony Corp.
Applicants: SONY CORP, SONY CORPORATION
Application year: 1996
Main classification: H04N7
IPC codes: H04N7, H03M7