Embodiment
Embodiments of the present invention are described with reference to the accompanying drawings.
Fig. 1 is the schematic diagram that is used to illustrate principle of the present invention.
In the explanation of following Fig. 1, to using situation of the present invention to describe in following picture coding device: this picture coding device can be encoded to the dynamic image data of being imported, generation dynamic image stream, and with this dynamic image stream is example, sound stream is carried out multiplexing, and with its output.This picture coding device shown in Figure 1 has encoding processor the 1, the 1st counter 2, frame information test section 3, frame information preservation portion 4 and multiplexing processing section 5.In addition, in multiplexing processing section 5, be provided with header information insertion section 6 and the 2nd counter 7.
Encoding processor 1 is carried out compressed encoding with the coded system of regulation to the dynamic image data of being imported, and generates dynamic image stream.In dynamic image stream, frame by frame or word for word section ground generates data behind the compressed encoding as image.
The quantity of the image that the 1st counter 2 countings generate in encoding processor 1.The count value of this moment is outputed in the frame information preservation portion 4.
Frame information test section 3 detects frame information from the dynamic image data of being imported.Wherein, frame information is represented the frame intrinsic information in the dynamic image data.For example, can comprise and be illustrated in the information that changes as occurrence scene in the frame of object and at vertical blanking interval (VBI: the VBI information of Bao Cuning etc. vertical blanking interval).For example in the input section of encoding processor 1, be provided with under the situation of frame memory of the dynamic image data that temporary transient storage imports, can utilize the data that are stored in this frame memory to detect this frame information.
In frame information preservation portion 4, this moment detected frame information in frame information test section 3 is associated with count value from the 1st counter 2, and with its preservation.
Dynamic image after multiplexing processing section 5 will be encoded in encoding processor stream and the sound stream behind the voice data coding is carried out multiplexing generates multiplex stream.In this multiplexing processing section 5, header information insertion section 6 is inserted into the header information of regulation from the dynamic image stream that encoding processor 1 receives.
The quantity of the image in the dynamic image stream that the 2nd counter 7 counting header information insertion sections 6 receive, and export to header information insertion section 6.
Herein, header information insertion section 6 is when carrying out the insertion of header information, and reference frame information storing section 4 is obtained the frame information corresponding to the count value identical with the count value of the 2nd counter 7.And, this frame information is write in the header information corresponding with the initial data of the image that receives at this moment.For example, be written in the packets of information head of the packets of information that comprises this initial data.
In such picture coding device, in encoding processor 1, the dynamic image data of being imported is carried out compressed encoding, it is offered multiplexing processing section 5 as dynamic image stream.In multiplexing processing section 5, in header information insertion section 6, it is inserted header information, and it is carried out multiplexing with sound stream, and export as multiplex stream.
In addition, utilize in the dynamic image data of frame information test section 3 from be input to encoding processor 1 and detect frame information, in frame information preservation portion 4, the count value of this frame information and the 1st counter 2 is mapped and preserves.Thus, frame information and the image corresponding with the frame that becomes its detection resources are mapped.
At this, because the quantity of 2 pairs of images that generate in encoding processor 1 of the 1st counter is counted, the quantity of the image that 7 pairs of header information insertion sections of the 2nd counter 6 receive is counted, therefore, when the 1st counter 2 and the 2nd counter 7 were identical count value, the image that becomes the counting object was identical.So header information insertion section 6 by obtaining the frame information corresponding to the count value of 1st counter 2 identical with the count value of the 2nd counter 7 at this moment, can obtain the frame information corresponding with the image that is received reliably when receiving image.
In header information insertion section 6, for example, when the image that receives from encoding processor 1, the initial part of recognition image, the 2nd counter 7 of this moment is increased progressively, utilize this count value to obtain frame information, can easily the frame information that is obtained be written in the header information corresponding with the initial data of image thus.So, in multiplex stream, each writing position of the data of frame information and the image corresponding with it correctly is consistent, when playing this multiplex stream, can be to extract and to utilize frame information with the synchronous correct timing of playing image.
Next, embodiments of the invention are elaborated.In the following description, suppose and using situation of the present invention in to the device of the encoding video signal imported in the MPEG-2 mode.In addition, as frame information, be the information that the expression scene of being added changes the information that takes place.
Fig. 2 is the block diagram of structure of the mpeg encoded device of expression embodiment of the present invention.
The represented mpeg encoded device of Fig. 2 is in the MPEG-2 mode video data and the voice data of being imported to be carried out the device that compressed encoding generates mpeg stream.This mpeg encoded device has frame memory 10, scene change detecting circuit 20, video coding portion 30, audio coder 40 and multiplexing unit 50.
The video and audio signal that is input to this mpeg encoded device is for example imported as analog signal from external equipments such as TV tuner.Vision signal is for example imported as composite signal, after in not shown Y/C separator, it being separated into luminance signal and color difference signal, utilize not shown NTSC (national television systems committee) decoder to carry out A/D conversion and chroma coder processing again, and be input in the frame memory 10 as numerical data.
Frame memory 10 is buffer storage of FIFO (first-in first-out) mode with a plurality of frame capacity, the video data that sequentially temporary transient storage is imported.And, read the data of being stored by video encoder 31 and scene change detecting circuit 20.
When by video encoder 31 when frame memory 10 is read the video data of a frame, scene change detecting circuit 20 is read becomes frame and its previous frame that is stored in the frame memory 10 of reading object, carries out the detection that scene changes.In the detection that scene changes, for example statistical disposition is included in 2 pixel values in the frame, can use the method for obtaining the difference between the frame or obtain the method etc. of the coefficient correlation between the frame.In these detect, for example can only use luminance signal or only use color difference signal as pixel value.In addition, scene change detecting circuit 20 possesses register 21, and according to testing result, the information that has or not occurrence scene to change expression is kept in the register 21.
In video coding portion 30, be provided with video encoder 31, counter 32 and scene change information treatment circuit 33.Video encoder 31 frame by frames are read the video data that is stored in the frame memory 10, carry out compressed encoding in the MPEG-2 mode and generate image, and export it to multiplexing unit 50 as video ES (basic stream).In addition, 1 image of video encoder 31 every generations increases progressively with regard to the count value that makes counter 32, and the generation of image is notified to scene change information treatment circuit 33.
The quantity of 32 pairs of images that generate in video encoder 31 of counter is counted, and count value is exported to scene change information treatment circuit 33.When scene change information treatment circuit 33 when video encoder 31 is received the notice that image generates, obtain the count value of the counter 32 after increasing progressively, and with reference to the register 21 of scene change detecting circuit 20, judge to have or not scene to change, the information that has or not scene to change expression stores in the memory 34 with the count value of being obtained.In memory 34, for example store the form that is mapped with count value that has or not with the scene variation.Perhaps, the count value in the time of also can only sequentially storing the occurrence scene variation.
On the other hand, the simulated audio signal of input is input in the audio coder 40 after converting numerical data to by not shown A/D converter.Audio coder 40 carries out compressed encoding in mpeg audio mode etc. to the voice data of input, outputs to multiplexing unit as audio ES.
In multiplexing unit 50, be provided with video ES buffer 51, audio ES buffer 52, MUX (multiplexer) 53, counter 54 and collation process circuit 55.
Video ES buffer 51 and audio ES buffer 52 are that respectively sequential storage and is exported to the buffer storage of the FIFO mode of MUX 53 from the video ES of video encoder 31 with from the audio ES of audio coder 40.
MUX 53 calls over data from video ES buffer 51 and audio ES buffer 52, carries out when writing head zone multiplexingly in system information that will regulation, generates mpeg stream.In addition, when MUX 53 when video ES buffer 51 is read the initial part of image, count-up counter 54 also is notified to the collation process circuit with reading of image.Then, be received in this image the judged result whether occurrence scene changes, in the head of the packets of information of the initial data of preserving image, write scene change information corresponding to judged result from collation process circuit 55.
The quantity of the image that counter 54 counting MUX 53 read from video ES buffer 51 is exported to collation process circuit 55 with count value.When collation process circuit 55 when MUX 53 receives the control signal of reading of notice image, the count value of usage counter 54 with reference to memory 34, judges that to same count value whether occurrence scene changes, and its result of determination is notified to MUX 53.
The elemental motion of this mpeg encoded device is as described below.The video data of input is saved in the frame memory 10 in proper order.In frame memory 10, each frame of the video data preserved is distributed image type, call over the data of each frame according to encoding process corresponding to image type by video encoder 31.1 frame data that 31 pairs of video encoders the are read generation image of encoding is saved in the data of image in the packets of information and exports in proper order as video ES.
The video ES that generates temporarily is kept in the video ES buffer 51, and from MUX 53, calls over.In addition, the audio ES that will generate in audio coder 40 also temporarily is kept in the audio ES buffer 52, and calls over from MUX 53.MUX 53 carries out multiplexing when the system information with necessity is inserted in the video ES that reads and the audio ES, generates mpeg stream and output.At this moment, the scene change information of additional result of determination based on collation process circuit 55 on the option area of the head of video information packets.
Next, describe in the processing of mpeg stream insertion scene change information being used for.
At first, to be kept at the video data in the frame memory 10, detect the generation that scene changes by the scene change detecting circuit.As mentioned above; From frame memory 10, read the data of each frame by video encoder 31 according to the encoding process order.Scene change detecting circuit 20 is whenever read 1 frame data from video encoder 31, just has or not scene to change according to the data of this frame and the Data Detection of its former frame, and testing result is kept in the register 21.
In video coding portion 30, video encoder 31 is whenever read 1 frame data and is generated 1 image from frame memory, with regard to the count value of count-up counter 32, and scene change information treatment circuit 33 judges with reference to register 21 and has or not scene to change, and carries out writing to memory 34.
Fig. 3 is the flow chart of the handling process in the expression video coding portion 30.Below, use this flow chart the processing in video coding portion 30 to be described along step number.
At step S301, video encoder 31 is read 1 frame video data from frame memory 10.Then,, according to the MPEG-2 mode data of being read are carried out compressed encoding and handle, generate 1 image at step S302.In addition, temporarily store the data of generation image into not shown output buffer after, it is outputed to the video ES buffer 51 of multiplexing unit 50.
At step S303, according to control signal from video encoder 31, the count value of count-up counter 32.Meanwhile, at step S304, scene change information treatment circuit 33 is judged to have or not scene to change with reference to register 21.At step S305, scene change information treatment circuit 33 count values with result of determination sum counter 32 are mapped and are kept in the memory 34.
At step S306, whether determination processing finishes, and returns step S301 under situation about proceeding, and reads the next frame video data, carries out compressed encoding.
By above processing, in memory 34, preserve the count value of distributing to each image that generates by video encoder 31 and be illustrated in whether the information that scene changes has taken place in each image.On the other hand, in multiplexing unit 50, utilize the quantity of the image that 54 couples of MUX 53 of counter read from video ES buffer 51 to count, by this count value and the count value that is kept in the memory 34 are checked, can be identified in easily whether the scene variation has taken place in the image of reading.
Fig. 4 is the flow chart of the handling process in the expression multiplexing unit 50.Below, utilize this flow chart to describe according to the processing of step number to multiplexing unit 50.
At step S401, MUX 53 reads the data that are stored in the video ES buffer 51.At this moment, for example reading with PES (Packetized Elementary Stream: grouping is stream substantially) packets of information is the unit data of unit.At step S402, MUX 53 judges the initial part that whether comprises image in the data of reading.This judgement is to begin code (Picture Start Code) by the image of being recorded and narrated in the head of reading image layer to carry out.Enter step S403 under the situation of initial part comprising, under situation about not comprising, enter step S406.
At step S403,, counter 54 is increased progressively according to control signal from MUX 53.At step S404, collation process circuit 55 is with reference to the storage data of memory 34, read corresponding to increase progressively after the information of the identical numerical value of the count value of counter 54, judge to have or not scene to change and notice MUX 53.At step S405, MUX 53 is according to the result of determination of collation process circuit 55, the scene change information is inserted in the option area in the head of PES packets of information.In addition, the insertion position about the scene change information will illustrate in Fig. 5 of back.
At step S406, MUX 53 utilizes the data of reading from audio ES buffer 52, generates the audio-frequency information bag, and it is multiplexed with output signal.At step S407, MUX 53 generates the video information packets in the head zone that system information with other necessity is inserted into regulation, and it is multiplexed with output signal.
At step S408, whether judge end process under situation about proceeding, to be back to step S401, in MUX 53, handle the data of reading from video ES buffer 51.By above processing, added the system flow of the MPEG-2 mode of scene change information from MUX 53 order outputs.
Fig. 5 is the exemplary plot of the form of the expression head zone of inserting the scene change information.
By the multiplexing process of MUX 53, will be saved in the PES packets of information from the data that video ES buffer 51 is read.In addition, in the initial data of frame was included in PES packets of information in the payload (pay load), head zone was expanded, and is provided with the storage area of timestamp etc. in this extended area, and the option area that is called as 16 bytes of PES exclusive data.So, by in this option area, inserting the scene change information, can be regularly synchronous when playing with the broadcast of image, correctly take out the scene change information.
In the present embodiment, in this PES exclusive data zone, writing down the quantity of the image that has or not scene to change and counted by counter 54.For example, in the 1st byte, the information of record about having or not scene to change.In this zone, under the situation that occurrence scene changes, write " 1 ", under the situation that occurrence scene does not change, write " 0 ".Then, in the zone of the 2nd byte~the 5th byte, represent that with 32 data record image becomes the information what are opened from encoding at first.The count value of these value usage counters 54.
In above mpeg encoded device, each image that will generate in video encoder 31 is mapped with the information that expression has or not scene to change, and is kept in the memory 34.And, in multiplexing unit 50,,, check count value with reference to memory 34 by the quantity of image being counted when the multiplexing process, judge in this image, to have or not scene to change, will be inserted in the multiplex stream corresponding to the scene change information of result of determination.
Like this, be that unit discerns and has or not scene to change by quantity with image, in MUX 53, can with the multiplexing process of view data synchronously and correctly insert the scene change information, the original position that its insertion position can the slip chart picture.And, by being inserted into the position as PES exclusive data zone, can be correctly and easily guarantee image and scene change information synchronously.Therefore, can when the mpeg stream that play to generate, correctly extract generation that scene changes regularly, for example can correctly carry out synchronously with playing image to the visit of the start-up portion of each scene and the generation of rough image etc.
In addition, in the above-described embodiment, be illustrated, but also can be applied in the situation of encoding according to field to come the situation of coding video frequency data according to frame.In this case, the scene change detecting circuit also can and detect scene in two fields that store into the frame memory in its front according to the field of being read from frame memory by video encoder and changes.
In addition, in the above description, be that unit discerns and has or not scene to change with the quantity of image, but also can be with GOP (Group Of Picture: be that unit discerns image sets).In this case, in video encoder 31, when generating the start image of GOP, count, this count value and expression are had or not the information write-in memory of scene variation.And, in multiplexing unit too, when the start image of multiplexing GOP, have or not scene to change with reference to above-mentioned memory judgement.In addition, the scene change information is inserted in the PES packets of information that comprises the GOP head.In this case, the writing position of scene change information only postpones the number frame from the position that actual occurrence scene changes sometimes, but can generally be located at the start-up portion positioning function in the playing device of MPEG-2 mode usually, determines the occurrence positions that scene changes.
In addition, perhaps inferior by the beginning of user's repeated video/stop action in the situation of a plurality of programs being carried out the timer video recording, newly begin the timing of recording a video by inserting the scene change information when the video recording beginning, can from played data, extracting out.Be used under the situation of this purposes, the scene change information for example can be inserted in the user data area of adjacency of sequence header back.
In addition, under the situation of the code device that utilizes the MPEG-1 mode to encode, for example, by before the position of the initial data of multiplexed frame, the specific information bag of scene change information has been preserved in insertion, can correctly extract the occurrence positions that scene changes when playing out.
As mentioned above, according to picture coding device of the present invention, in the time of in the data after header information is inserted into coding,, can obtain the frame information corresponding with the image that generates by the reference frame information storing section.So, can frame information be write in the header information corresponding reliably with the initial data of this image, can prevent that writing position is offset.
In addition, according to method for encoding images of the present invention, frame information and the 1st amount of images are being mapped and are preserving, when inserting header information in the data behind the coding, check by image that will be received and the 2nd amount of images that counts out, can obtain the frame information corresponding with the image that generates.Therefore, can frame information be write in the header information corresponding reliably, can prevent that writing position is offset with the initial data of this image.
Above-mentionedly only represent principle of the present invention.And, for industry personnel, can carry out various deformation, change, the present invention do not limit with above-mentioned shown in, illustrated correct structure and application examples, corresponding all variation and equivalent are all thought in the scope of the present invention of claims and its equivalent.