The present invention relates to an output circuit, a control program product, and a control method, particularly to the output circuit, control program product, and control method for dealing with data received through a communication network.
Recently, in an in-home network, a technique of transferring real-time data such as AV data by an IP (Internet Protocol) packet is being grown. In such cases, a difference between an amount of data transferred per unit time and an amount of data reproduced per unit time is generated due to a time lag of clocks between an encoder (encoding circuit) and a decoder (decoding circuit), which possibly results in a problem such as degradation of image quality.
As shown in
Although the synchronization system in which the PLL circuit is used is an effective technique when a fluctuation (jitter) in delay is small in the network, the synchronization system is not the effective technique in the network such as the IP data communication network in which a large jitter is generated.
A method called adaptive clock is usually used to solve the problem. In the method called adaptive clock, as shown in
For example, a timing at which the received data is outputted based on the clock on the receiver side is determined by comparing a value of timing information (time stamp) added to each packet to a counter synchronized with the clock on the receiver side, which allows the decoder to be operated in synchronization with time information for driving the buffer of the receiver.
Therefore, a speed at which the data is transmitted to the decoder of receiver 1302 is different from a speed at which a transmitter 1301 transmits the data, so that the data in the receiving buffer is increased or decreased on a long-term basis.
Japanese Patent Laying-Open No. 2000-174742 (Patent Document 1) and Japanese Patent Laying-Open No. 2002-165148 (Patent Document 2) disclose a technique of preventing overflow (hereinafter also referred to as overrun) and underflow (hereinafter also referred to as underrun) of the receiving buffer.
In the technique disclosed in Japanese Patent Laying-Open No. 2002-165148 (Patent Document 2), the data accumulated in the buffer is monitored, a data output speed is increased when the number of bytes of the accumulated data or a difference in time stamp value between the leading data and last data in the buffer exceeds an upper limit, and the data output speed is decreased when the number of bytes or the difference in time stamp value falls below a lower limit, thereby preventing the generation of the overflow and underflow.
In the conventional technique, as described above, the number of bytes of the data buffered in the buffer or the difference in value between the pieces of timing information added to the pieces of data is used to monitor the change in amount of data buffered in the receiving buffer.
On the other hand, in the digital data transmission, recently an attempt to transfer the encoded data and decode the encoded data immediately before the reproduction is made from the viewpoint of copyright protection. In the encoded data, the timing information added to the data pieces is also transferred in the encoded state.
In the case where the encoded data including the encoded timing information is received, in order to monitor the change in buffer amount with the difference between the values of the pieces of timing information, it is necessary that the encoded data be tentatively decoded to perform the buffering. However, because it is highly possible that the data on the buffer is obtained through an unintended method, the process of tentatively decoding the encoded data is undesirable from the viewpoint of copyright protection.
Additionally, the processing speed is limited in the decode process. When the data is received in a burst manner beyond the processing speed of the decode process, it is necessary to provide another buffer memory before the decode process, which results in a problem of cost increase.
Even if the timing information is encoded, the use of the timing information in the data is not required when the number of bytes accumulated in the buffer is utilized. However, the number of bytes accumulated in the buffer is momentarily changed in a VBR (Variable Bit Rate) transmission in which a transfer speed fluctuates as time advances. Therefore, in the VBR transmission, accurate control cannot be performed even if the change in buffer amount is monitored to control the data output based on the difference between the buffer output speed and the buffer input speed. As a result, the overrun or underrun is generated and the data cannot accurately be restored.
In view of the foregoing, an object of the present invention is to provide an output circuit capable of outputting data at correct timing.
Another object of the present invention is to provide a program product or a program capable of outputting data at correct timing.
Still another object of the present invention is to provide a control method capable of outputting data at correct timing.
In order to solve the foregoing problems, an output circuit in accordance with one aspect of the present invention includes: a storage unit to store data; an accumulation unit to store the data in the storage unit; an output request unit to provide an output request for the data stored in the storage unit; an output unit to output the data stored in the storage unit in response to the output request; and a computation unit to compute an elapse time until the output unit outputs second data stored in the storage unit since the accumulation unit stores first data in the storage unit, wherein the output request unit changes a speed at which the output unit outputs the data based on the elapse time.
Preferably, the output request unit increases the speed at which the output unit outputs the data when the elapse time reaches a predetermined upper limit, and the output request unit decreases the speed at which the output unit outputs the data when the elapse time reaches a predetermined lower limit.
Preferably, the computation unit computes a characteristic of the elapse time for a predetermined time by a predetermined calculation using predetermined pieces of information on the elapse time which is changed based on the data stored in the storage unit, and the output request unit changes the speed at which the output unit outputs the data based on the characteristic of the elapse time.
Preferably, the predetermined calculation is a calculation by a least-square method.
Preferably, the elapse time is a time period corresponding to a difference between time at which the accumulation unit stores the first data in the storage unit and time at which the output unit outputs the second data stored in the storage unit.
Preferably, the elapse time is a time period based on the number of clock counts counted until the output unit outputs the second data stored in the storage unit since the accumulation unit stores the first data in the storage unit.
Preferably, the first data and the second data are the same data.
Preferably, predetermined pieces of data are stored in the storage unit during a period until the second data is stored in the storage unit since the first data is stored in the storage unit.
An output circuit in accordance with another aspect of the present invention includes: a storage unit to store data; an accumulation unit to store encrypted data in the storage unit; an output request unit to provide an output request for the encrypted data stored in the storage unit; a first output unit to output the encrypted data from the storage unit in response to the output request; a decryption unit to decrypt the encrypted data outputted from the first output unit; a second output unit to output the decrypted data decrypted by the decryption unit; and a computation unit to compute an elapse time until the first output unit outputs second encrypted data stored in the storage unit since the accumulation unit stores first encrypted data in the storage unit, wherein the second output unit changes a speed at which the decrypted data is outputted based on the elapse time.
Preferably, the second output unit increases the speed at which the decrypted data is outputted when the elapse time reaches a predetermined upper limit, and the second output unit decreases the speed at which the decrypted data is outputted when the elapse time reaches a predetermined lower limit.
Preferably, the computation unit computes a characteristic of the elapse time for a predetermined time by a predetermined calculation using predetermined pieces of information on the elapse time which is changed based on the encrypted data stored in the storage unit, and the second output unit changes the speed at which the decrypted data is outputted based on the characteristic of the elapse time.
Preferably, the predetermined calculation is a calculation by a least-square method.
Preferably, the first encrypted data and the second encrypted data are the same data.
An output circuit in accordance with yet another aspect of the present invention includes: a storage unit to store data; an accumulation unit to store encrypted data in the storage unit; a first output unit to output the encrypted data from the storage unit; a decryption unit to decrypt the encrypted data outputted from the first output unit; a second output unit to output the decrypted data decrypted by the decryption unit in response to an output request; an output request unit to provide the output request to the second output unit; and a computation unit to compute an elapse time until the first output unit outputs second encrypted data stored in the storage unit since the accumulation unit stores first encrypted data in the storage unit, wherein the output request unit changes a speed at which the second output unit outputs the decrypted data based on the elapse time.
Preferably, the output request unit increases the speed at which the second output unit outputs the decrypted data when the elapse time reaches a predetermined upper limit, and the output request unit decreases the speed at which the second output unit outputs the decrypted data when the elapse time reaches a predetermined lower limit.
Preferably, the computation unit computes a characteristic of the elapse time for a predetermined time by a predetermined calculation using predetermined pieces of information on the elapse time which is changed based on the encrypted data stored in the storage unit, and the output request unit changes the speed at which the second output unit outputs the decrypted data based on the characteristic of the elapse time.
Preferably, the predetermined calculation is a calculation by a least-square method.
Preferably, the first encrypted data and the second encrypted data are the same data.
In accordance with yet another aspect of the present invention, an output circuit outputs data in response to an output request from an external circuit, and the output circuit includes: a storage unit to store data; an accumulation unit to store the data in the storage unit; an output unit to output the data stored in the storage unit in response to the output request; and a computation unit to compute an elapse time until the output unit outputs second data stored in the storage unit since the accumulation unit stores first data in the storage unit, and to notify the external circuit of the elapse time as information for controlling timing of the output request.
Preferably, the elapse time is a time period corresponding to a difference between time at which the accumulation unit stores the first data in the storage unit and time at which the output unit outputs the second data stored in the storage unit.
Preferably, the elapse time is a time period based on the number of clock counts counted until the output unit outputs the second data stored in the storage unit since the accumulation unit stores the first data in the storage unit.
Preferably, the first data and the second data are the same data.
Preferably, predetermined pieces of data are stored in the storage unit during a period until the second data is stored in the storage unit since the first data is stored in the storage unit.
In accordance with yet another aspect of the present invention, an output circuit outputs data in response to an output request from an external circuit, and the output circuit includes: a storage unit to store data; an accumulation unit to store the data in the storage unit; an output unit to output the data stored in the storage unit in response to the output request; and a notification unit to notify the external circuit of time at which the accumulation unit stores first data in the storage unit and time at which the output unit outputs second data stored in the storage unit as information for controlling timing of the output request.
Preferably, the first data and the second data are the same data.
In accordance with yet another aspect of the present invention, a control program product causes a computer to perform data processing, and the control program product causes the computer to execute the steps of: storing data in a storage unit of the computer; providing an output request for the data stored in the storage unit; outputting the data stored in the storage unit in response to the output request; computing an elapse time until second data stored in the storage unit is outputted since first data is stored in the storage unit; and changing a speed at which the data is outputted based on the elapse time.
Preferably, the first data and the second data are the same data.
In accordance with yet another aspect of the present invention, there is provided a control method performed by an output circuit provided with a storage unit, the control method including the steps of: storing data in a storage unit; providing an output request for the data stored in the storage unit; outputting the data stored in the storage unit in response to the output request; computing an elapse time until second data stored in the storage unit is outputted since first data is stored in the storage unit; and changing a speed at which the data is outputted based on the elapse time.
Preferably, the first data and the second data are the same data.
In the output circuit according to the present invention, the speed at which the data is outputted is changed based on the elapse time until the second data stored in the storage unit is outputted since the first data is stored in the storage unit.
Accordingly, the data can be outputted at correct timing.
In the output circuit according to the present invention, the speed at which the data is outputted is changed based on the elapse time until the second encrypted data stored in the storage unit is outputted since the first encrypted data is stored in the storage unit.
Accordingly, the data can be outputted at correct timing.
In the output circuit according to the present invention, the speed at which the data is outputted is changed based on the elapse time until the second encrypted data stored in the storage unit is outputted since the first encrypted data is stored in the storage unit.
Accordingly, the data can be outputted at correct timing.
In the output circuit according to the present invention, on the basis of the elapse time until the second data stored in the storage unit is outputted since the first data is stored in the storage unit, the external circuit is notified of the elapse time as the information for controlling the timing at which the external circuit provides the output request. The output circuit outputs the data in response to the output request from the external circuit.
Accordingly, the data can be outputted at correct timing.
In the output circuit according to the present invention, the external circuit is notified of the time at which the first data is stored in the storage unit and the time at which the second data stored in the storage unit is outputted as the information for controlling the timing at which the external circuit provides the output request. The output circuit outputs the data in response to the output request from the external circuit.
Accordingly, the data can be outputted at correct timing.
In the program product according to the present invention, the speed at which the data is outputted is changed based on the elapse time until the second data stored in the storage unit is outputted since the first data is stored in the storage unit.
Accordingly, the data can be outputted at correct timing.
In the control method according to the present invention, the speed at which the data is outputted is changed based on the elapse time until the second data stored in the storage unit is outputted since the first data is stored in the storage unit.
Accordingly, the data can be outputted at correct timing.
100 and 100B transmitter, 200, 200A, 200B, and 200C receiver, 210 decoder, 230 communication unit, 240, 240A, 240B, and 240C output circuit, 250 and 250B processing unit, 244, 245, 248A, and 248B storage unit, 300 storage medium, 310 control program, 1000 network system
Preferred embodiments of the present invention will be described below with reference to the drawings. In the following description, because the same component is designated by the same numeral and has the same name and function, the detailed description of the same component is not repeated.
Example of MPEG2-TS real-time stream transmission with RTP (Real Time Protocol) through an IP (Internet Protocol) network will be described in the following embodiments of the present invention. However, the present invention is not limited to the embodiments.
Referring to
For example, network 50 is a network such as the Internet. Transmitter 100, receiver 200, instrument 20, and instrument 30 are connected to network 50.
Transmitter 100 performs the real-time stream transmission with receiver 200 through network 50.
Instruments such as a video cassette recorder, an HDR, and a digital tuner may be used as transmitter 100 as long as the instrument has a communication function capable of transmitting image data.
Receiver 200 has a function of receiving real-time data transmitted from transmitter 100 through network 50. Instruments such as a television set and a liquid crystal projector may be used as receiver 200 as long as the instrument has a communication function capable of receiving image data.
Instruments 20 and 30 are other instruments connected to network 50.
Referring to
Encoder 110 has functions of encoding an inputted image signal and outputting data after encoding. Encoder 110 includes a clock 112 and encode unit 114. Encode unit 114 encodes the inputted image signal according to a predetermined encoding method, and outputs data (hereinafter also referred to as encoded data) after the encoding. At this point, it is assumed that MPEG2 is the predetermined encoding method. Clock 112 counts a encoding time necessary for the encoding.
Examples of processing unit 120 include a microprocessor, an FPGA (Field Programmable Gate Array) which is a programmable LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit) which is an integrated circuit designed and produced for a specific application, and other circuits having computation functions.
Processing unit 120 sequentially converts the encoded data outputted from encode unit 114 into data (hereinafter also referred to as streaming data) in a format capable of being transferred on the network, and sequentially outputs the streaming data to communication unit 130. The streaming data is a packet.
In the present embodiment, the streaming data transmitted from transmitter 100 to receiver 200 is either streaming data STD100 or streaming data STD 200.
Referring to
Receiver 200 receives the streaming data as the packets sequentially transmitted from transmitter 100.
Receiver 200 includes a communication unit 230, an output circuit 240, a recording medium access unit 260, and a decoder 210.
Communication unit 230 has a function of receiving the data sequentially transmitted from transmitter 100 through network 50. Communication unit 230 is an interface similar to communication unit 130, so that the detailed description is not repeated.
Output circuit 240 includes a processing unit 250, a storage unit 244, and a storage unit 245. Storage unit 244 acts as a FIFO (First In First Out) type buffer capable of tentatively retaining data. Storage unit 245 is a memory capable of retaining data. A control program 310 for causing processing unit 250 to perform the later-described processes, various programs, and various pieces of data are stored in storage unit 245. Processing unit 250 performs data access to storage units 244 and 245.
Processing unit 250 is a circuit having a similar function to that of the processing unit 120, so that the detailed description is not repeated. Processing unit 250 has functions of performing various processes to each instrument in receiver 200, a computation process, and the like according to control program 310 stored in storage unit 245.
Processing unit 250 includes a difference monitoring unit 251, an accumulation unit 252, an output request unit 253, and an output unit 254. The functions of processing unit 250 are shared by difference monitoring unit 251, accumulation unit 252, output request unit 253, and output unit 254 which perform the later-described processes. A processing unit provided separately from processing unit 250 may include output request unit 253 and output unit 254. All or part of the units included in processing unit 250 may be configured by hardware.
Output request unit 253 provides an output request at a predetermined timing to output unit 254 to output the data stored in storage unit 244. Output unit 254 outputs the data stored in storage unit 244 to decoder 210 in response to the output request from output request unit 253.
Decoder 210 has a function of decoding the received data. Decoder 210 includes a clock 212 and a decode unit 214.
Recording medium access unit 260 has a function of reading control program 310 from recording medium 300 in which control program 310 is recorded. Control program 310 stored in recording medium 300 is read by an operation (install process) of processing unit 250 from recording medium access unit 260 and stored in storage unit 245.
The install processing program is previously stored in storage unit 245, and processing unit 250 performs the install process based on an install processing program.
Control program 310 may not be installed in storage unit 245. In this case, processing unit 250 reads control program 310 stored in recording medium 300 through recording medium access unit 260, and performs a predetermined process based on control program 310.
Examples of recording medium 300 include a DVD-ROM (Digital Versatile Disk Read Only Memory), a DVD-R (Digital Versatile Disk Recordable), a DVD-RAM (Digital Versatile Disk Random Access Memory), a DVD+RW (Digital Versatile Disk Re-Writable), a DVD-RW, a CD-ROM (Compact Disk Read Only Memory), an MO (Magneto Optical Disk), a Floppy (registered trademark) disk, a CF (Compact Flash) card, an SM (Smart Media (registered trademark)), an MMC (Multi Media Card), an SD (Secure Digital) memory card, a MEMORY STICK (registered trademark), an xD picture card, a USB memory, a magnetic tape, a hard disk and other nonvolatile memories.
Receiver 200 can perform a program download process through communication unit 230 from network 50 to store the program in storage unit 245. In this case, the downloaded program is control program 310.
Processing unit 250 performs a predetermined process according to the program (control program 310) downloaded from network 50. A downloading program is previously stored in storage unit 245, and processing unit 250 performs the download process based on the downloading program.
Decode unit 214 decodes the MPEG2 data outputted from output unit 254.
Clock 212 generates a clock to reproduce the received data based on both time information on the time stamp (TS) included in the data outputted from output unit 254 and the timing at which the data is inputted to decoder 210. Clock 212 includes a circuit called PLL (Phase Locked Loop). Decode unit 214 reproduces images and sounds based on the timing at which the clock is generated by clock 212.
In the present embodiment, various processes described below are simultaneously started and independently performed.
In step S112, accumulation unit 252 stores the received packet in storage unit 244.
The pieces of data newly stored in storage unit 244 are stored with the region having the address indicated by the variable buffer_tail in the lead. Accordingly, in the process in step S112, the packet is stored in the region L of storage unit 244. The pieces of data are stored in the regions L and K in the case where a size of the data to be stored in storage unit 244 is larger than the region L.
Referring to
In step S114, accumulation unit 252 transmits a storage notification that the packet is already stored to difference monitoring unit 251. The storage notification includes a value of the variable buffer_tail indicating the leading address where the packet is stored. The storage notification also includes information on the time (hereinafter also referred to as storage time) at which the packet is stored. Then, the procedure proceeds to step S116.
In step S116, accumulation unit 252 increases the value of the variable buffer_tail by the number of bytes of the data stored in the process in step S112, which changes a position where the next packet is to be written. Then, the process in step S110 is performed again.
Referring to
In step S121, on the basis of the received storage notification, difference monitoring unit 251 stores the value of the variable buffer_tail and information on the storage time included in the storage notification in storage unit 245 while the value of the variable buffer_tail and information on the storage time are correlated with each other. In this case, the value of the variable buffer_tail indicates the leading address (hereinafter also referred to as storage address) of the address where the packet is stored.
Referring to
In step S122, difference monitoring unit 251 determines whether or not output request unit 253 has provided the output request to output unit 254. The output request includes the address (storage address) of storage unit 244 from which the data shall be read. When output unit 254 receives the output request, output unit 254 reads from storage unit 244 the data whose address is specified in storage unit 244 and outputs the data to decoder 210. If YES in step S122, the procedure proceeds to step S123. On the other hand, if NO in step S122, the process in step S120 is performed again.
In step S123, difference monitoring unit 251 stores time (hereinafter also referred to as output time) at which the output request is provided in storage unit 245 while the output time is correlated with the storage address included in the output request. That is, the data correlated with the storage address, storage time, and output time is stored in storage unit 245.
Referring to
In step S124, difference monitoring unit 251 computes a time period corresponding to a difference between the output time stored in the process in step S123 and the storage time corresponding to the output time. For example, in
As described above, the differential time indicates the time period as to how long storage unit 244 has retained the data stored therein. That is, the differential time also indicates an elapse time until the data is outputted since the data is stored in storage unit 244. Therefore, hereinafter the differential time is also referred to as elapse time. Then, the procedure proceeds to step S125.
In step S125, difference monitoring unit 251 notifies output request unit 253 of the information on the computed differential time. Then, the process in step S120 is performed again.
Although shown in detail later, output request unit 253 has a function of determining the timing of the output of the data stored in storage unit 244. Output request unit 253 monitors how the differential time changes as time advances. The increase in differential time as time advances shows that an amount of data stored in storage unit 244 is increased as time advances.
This is a phenomenon caused by a delay in the timing of the output request provided from output request unit 253 relative to the data transmission from transmitter 100. In this case, output request unit 253 quickens the timing of the output request. On the other hand, when the differential time is decreased as time advances, the timing of the output request provided from output request unit 253 is faster. In this case, output request unit 253 slows the timing of the output request. Although described in detail later, output request unit 253 determines that the differential time is increased when the differential time exceeds a predetermined upper limit, and output request unit 253 determines that the differential time is decreased when the differential time falls below a predetermined lower limit.
As described above, output circuit 240 of the first embodiment utilizes the differential time of the data without using the number of bytes of the data stored in storage unit 244 (buffer) or the value of the time stamp added to the packet. Output request unit 253 determines the timing of the data output according to the differential time.
Accordingly, even in the data compressed at a variable bit rate with which a data transfer rate changes or the encrypted data whose time stamp cannot be referred to, output request unit 253 can provide the output request to output unit 254 at correct timing. Therefore, output unit 254 can output the data stored in storage unit 244 at correct timing. That is, advantageously the data can be outputted at correct timing.
Although described in detail later, the differential time is also used to detect a time lag in operation clock between the receiver and the transmitter.
An output circuit as one mode of the present invention will be described in detail. The mode in which the output circuit is incorporated into the receiver in the real-time stream transmission will be described by way of example.
A network system according to the present embodiment differs from network system 1000 in that a receiver 200A is included instead of receiver 200. Because other configurations are similar to those of network system 1000, the detailed description is not repeated.
Output circuit 240A differs from output circuit 240 in that output circuit 240A further includes communication unit 230 and clock generator 247. Because other configurations are similar to those of output circuit 240, the detailed description is not repeated. Clock generator 247 transmits a reference clock to processing unit 250. As used herein, the reference clock shall mean a clock used to compute the elapse time from the start of the various processes described above or the various processes to be described later in the receiver.
Processing unit 250 is operated based on a clock different from the reference clock.
Receiver 200A receives streaming data as packets from transmitter 100 through network 50. The streaming data is streaming data STD100 (see
Each process performed in output circuit 240A will be described below with reference to a flowchart.
In step S212, communication unit 230 transmits the received data to accumulation unit 252. Then, the process in step S210 is performed again.
Referring to
Then, a process performed by output request unit 253 will be described. Output request unit 253 performs a clock counting process.
For example, in the case of the reference clock of 27 MHz, a time period (hereinafter also referred to as clock counting process time) until the time at which the process in step S310 is performed again since the time at which the process in step S310 is started is set within a cycle of the reference clock. In the case of the reference clock of 27 MHz, the cycle is 37 ns from 1/(27×106). Accordingly, it is necessary that the clock counting process time be set to 37 ns or less. Then, the procedure proceeds to step S311.
In step S311, output request unit 253 increments a counter C1 by one. Counter C1 counts the number of times on which the reference clock is obtained. Counter C1 is provided in storage unit 245. An initial value of counter C1 is set to zero. Then, the procedure proceeds to step S312.
In step S312, setting of a correction value H is performed. Specifically, output request unit 253 sets correction value H of counter C1 per unit time based on the latest information in the pieces of information on the differential time sequentially notified from difference monitoring unit 251 by the above-described process in step S125 of
Because the information on the differential time is sequentially notified from difference monitoring unit 251, the information used in the process in step S312 is set to the latest information on the differential time. The differential time is not always constant, and it fluctuates.
Correction value H of counter C1 is set to a predetermined value when the differential time becomes a predetermined upper limit or more or lower limit or less. Otherwise, correction value H determined in the previously performed process in step S312 is directly used as correction value H of counter C1.
The fact that the differential time becomes the predetermined upper limit or more shows that a speed at which the data is stored in storage unit 244 is faster than a speed at which the data is outputted from storage unit 244. That is, storage unit 244 will eventually generate overrun.
The fact that the differential time becomes the predetermined lower limit or less shows that the speed at which the data is stored in storage unit 244 is slower than the speed at which the data is outputted from storage unit 244. That is, storage unit 244 will eventually generate underrun. In order to prevent the phenomena, correction value H is set as follows.
In the present embodiment, in the case where the reference clock has the frequency of 27 MHz, it is assumed that the correction by e.g. 60 μs is required per second. In this case, 1620 is obtained from the computation of 27×106×60×10−6. The computed value of 1620 is the number of clock counts corresponding to the correction value per second (unit time).
When the notified differential time is not less than the predetermined upper limit (for example, 400000 μs), correction value H is set to −1620. When the notified differential time is not more than the predetermined lower limit (for example, 200000 μs), correction value H is set to 1620. Then, the procedure proceeds to step S313.
In step S313, output request unit 253 determines whether or not set correction value H is zero. If YES in step S313, the flow goes to step S313A to be described later. On the other hand, if NO in step S313, the procedure proceeds to step S314.
A cycle T during which a counter C2 is corrected is computed in step S314. At this point, counter C2 is a counter for determining the timing of the output of data stored in storage unit 244. Counter C2 is provided in storage unit 245. An initial value of counter C2 is set to zero. Cycle T indicates that counter C2 is set ahead by one time relative to the number of reference clocks. Cycle T is computed by an equation of (count value counted by reference clock per unit time)/(the number of clock counts corresponding to correction value per unit time).
For example, in the case where the reference clock has a clock frequency of 27 MHz, it is assumed that the correction by e.g. 60 μs required per second. In this case, because 60 μs corresponds to 1620 clock counts by the above-described computation, 16666.66 . . . is obtained by the computation of T=27000000/1620.
In the present embodiment, the counter is set ahead by incrementing the value of counter C2 by two (although usually incrementing the value by one) at a rate of one time for 16666 reference clock obtaining times, or the value of counter C2 is not increased but left as it is. The progress of counter C2 can be changed through this process. That is, the timing of the output of data stored in storage unit 244 can be changed. Then, the procedure proceeds to step S315.
In step S315, output request unit 253 determines whether or not a remainder of the division of counter C1 by cycle T is zero. The remainder of zero shows that the current time reaches cycle T of the correction. The remainder of a value except zero shows that the current time does not reach cycle T of the correction. If YES in step S315, the procedure proceeds to step S316. On the other hand, if NO in step S315, the procedure proceeds to step S313A to be described later.
In step S316, output request unit 253 determines whether or not counter C2 is set ahead. That is, output request unit 253 determines whether counter C2 is set ahead or behind. The determination is made e.g. using a sign of correction value H per unit time set in step S312. When correction value H has the negative sign, output request unit 253 determines that counter C2 be set ahead, namely, output request unit 253 makes the clock count faster. When correction value H has the positive sign, output request unit 253 determines that counter C2 be set behind, namely, output request unit 253 makes the clock count slower.
If YES in step S316, the procedure proceeds to step S317. If NO in step S316, the process in step S310 is performed again. That is, if NO in step S316, the value of counter C2 is not increased by the reference clock obtained through the current process.
In step S317, output request unit 253 increments counter C2 by two. Then, the process in step S310 is performed again.
If YES in above-described step S313, or if NO in step S315, the procedure proceeds to step S313A.
In step S313A, output request unit 253 increments counter C2 by one. That is, counter C2 is incremented by one each time the reference clock is obtained. As a result, the count of the reference clock is not corrected by the reference clock obtained through the current process. Then, the process in step S310 is performed again.
Thus, in the clock counting process, the progress of counter C2 for determining the timing of the output of data stored in storage unit 244 is controlled based on the information on the differential time sequentially notified from difference monitoring unit 251.
Specifically, when the amount of data stored in storage unit 244 is not less than the predetermined upper limit, the progress of counter C2 is made faster. When the amount of data stored in storage unit 244 is not more than the predetermined lower limit, the progress of counter C2 is made slower. As described above, counter C2 is a counter for determining the timing of the output of data stored in storage unit 244. Therefore, the effect of preventing the generation of overrun or underrun in storage unit 244 is obtained through the above-described processes.
Referring to
In step S321, output request unit 253 reads the data having the oldest storage time in the plural pieces of data stored in storage unit 244. It is assumed that the read data is e.g. streaming data STD100 of
In step S322, whether or not the output time (timing) of the data has come is determined. Specifically, output request unit 253 determines whether or not the time indicated by the time stamp obtained in step S321 coincides with the value of counter C2 obtained in step S320. If YES in step S322, the procedure proceeds to step S323. On the other hand, if NO in step S322, the process in step S320 is performed again.
In step S323, output request unit 253 transmits the data output request to output unit 254. Then, the process in step S320 is performed again.
Then, a processing function of output unit 254 will be described.
Referring to
In step S331, output unit 254 refers to a value of a variable buffer_head (see
In step S332, output unit 254 transmits an output notification that the data has been outputted to decoder 210 to difference monitoring unit 251. The leading address (storage address) of storage unit 244 where the data is read is included in the output notification. Then, the procedure proceeds to step S333.
In step S333, output unit 254 increases the value of the variable buffer_head by the number of bytes of the data outputted through the process in step S331, which changes the output position of the next data (packet). Then, the process in step S330 is performed again.
As described above, in output circuit 240A of the second embodiment, the streaming data is received through network 50, the data is tentatively stored in storage unit 244, and output unit 254 outputs the tentatively-stored data to decoder 210.
The timing of the data output is dynamically controlled based on the differential time computed by difference monitoring unit 251. Therefore, the effect of preventing the generation of overrun or underrun in storage unit 244 is obtained.
The information on the differential time used to control the timing of the data output is independent of the number of bytes of the data stored in storage unit 244. Therefore, even if the number of bytes of the data stored in storage unit 244 fluctuates due to the fluctuation in bit rate like the VBR, output unit 254 can output the data stored in storage unit 244 to decoder 210 at correct timing. That is, the effect of outputting the data at correct timing is obtained.
In a present embodiment, an output circuit as another mode of the present invention will be described in detail. The mode in which the output circuit is incorporated into the receiver in the real-time stream transmission will be described by way of example.
A network system of the present embodiment differs from network system 1000 in that the network system includes a transmitter 100B instead of transmitter 100 while including a receiver 200B instead of receiver 200. Because other configurations are similar to those of network system 1000, the detailed description is not repeated.
Because processing unit 120B is a circuit having the same function as processing unit 120, the detailed description is not repeated. Processing unit 120B includes a first processing unit 121, an encryption unit 122, and a second processing unit 123. The functions of processing unit 120B are shared by first processing unit 121, encryption unit 122, and second processing unit 123 which perform the later-mentioned processes. All or part of the units included in processing unit 120B may be configured by hardware.
First processing unit 121 adds time stamp (TS) indicating the timing of reproduction to the MPEG2 data outputted from decoder 110, and transmits the data to encryption unit 122.
Encryption unit 122 encrypts the data received from first processing unit 121. For example, as shown in
Second processing unit 123 converts the data received from encryption unit 122 into the data capable of being transferred on the network. For example, as shown in
Communication unit 130 transmits the received data (streaming data) to network 50. The streaming data is streaming data STD 200 of
Receiver 200B differs from receiver 200A of
Output circuit 240B differs from output circuit 240A in that not only output circuit 240B further includes a storage unit 248A and a storage unit 248B but also output circuit 240B includes a processing unit 250B instead of processing unit 250. Because other configurations are similar to those of output circuit 240A, the detailed description is not repeated. Similarly to storage unit 244, storage units 248A and 248B have a function as FIFO type buffers in which the data can tentatively be stored.
Because processing unit 250B is a circuit having the same function as processing unit 120, the detailed description is not repeated. Processing unit 250B differs from processing unit 250 in that processing unit 250B further includes a decryption unit 255 and a data output unit 256. Because other configurations are similar to those of processing unit 250, the detailed description is not repeated. That is, similarly to processing unit 250, processing unit 250B has the function of performing various processes according to control program 310. The functions of processing unit 250B are shared by difference monitoring unit 251, accumulation unit 252, output request unit 253, output unit 254, decryption unit 255, and data output unit 256 which perform the later-mentioned processes. All or part of the units included in processing unit 250B may be configured by hardware.
Receiver 200B receives streaming data STD 200 as packets from transmitter 100B through network 50.
Then, each process performed inside output circuit 240B will be described in detail. In the present embodiment, the following various processes are simultaneously started and independently performed.
In step S122A, difference monitoring unit 251 determines whether or not the output notification has been received from output unit 254. The leading address (storage address) of storage unit 244 from which the data is read is included in the output notification. As described above, when output unit 254 reads the data from storage unit 244 and outputs the data to decoder 210, output unit 254 transmits the output notification to difference monitoring unit 251. If YES in step S122A, the procedure proceeds to step S123A. On the other hand, if NO in step S122A, the process in step S120 is performed again.
In step S123A, difference monitoring unit 251 stores the time (hereinafter also referred to as output time) at which the output notification is provided in storage unit 245 while the output time is correlated with the storage address included in the output notification. That is, the data in which the storage address, storage time, and output time are correlated with one another is stored in storage unit 245.
In step S125A, difference monitoring unit 251 notifies data output unit 256 of the information on the computed differential time. Then, the process in step S120 is performed again.
Referring to
In step S412, output request unit 253 transmits the data output request to output unit 254. The output request is an output request of the maximum data amount which does not exceed the empty region of storage unit 248A at that time. Then, the process in step S410 is performed again.
Referring to
Decryption unit 255 performs a decryption process.
In step S421, decryption unit 255 reads the data from storage unit 248A. It is assumed that the amount of data to be read is a maximum amount of data in which the number of bytes of the data does not exceed the empty region of storage unit 248B after the read data is decrypted. Then, the flow goes to step S422.
In step S422, decryption unit 255 decrypts the encrypted data read. For example, in the case where transmitter 100B encrypts the data by AES, the data is decrypted using a decrypting technique by the same AES. Then, the procedure proceeds to step S423.
In step S423, decryption unit 255 stores the decrypted data in storage unit 248B. Then, the process in step S420 is performed again.
Referring to
In step S431, data output unit 256 reads the data having the oldest storage time in the plural pieces of data stored in storage unit 248B. It is assumed that the read data is e.g. streaming data STD100 of
In step S432, whether or not the output time (timing) of the data has come is determined. Specifically, data output unit 256 determines whether or not the time indicated by the time stamp obtained in step S431 coincides with the value of counter C2 obtained in step S430. If YES in step S432, the procedure proceeds to step S433. On the other hand, if NO in step S432, the process in step S430 is performed again.
In step S433, data output unit 256 reads the data stored in storage unit 248B, and transmits the data to decoder 210. Then, the process in step S430 is performed again.
As described above, in output circuit 240B of the third embodiment, the encrypted streaming data is received through network 50, and the data decrypted by decryption unit 255 is outputted to decoder 210.
The speed at which the data is outputted to decoder 210 is dynamically controlled based on the differential time computed by difference monitoring unit 251. Therefore, even if the value of the time stamp included in the encrypted streaming data is not referred to, the speed at which the data is outputted to decoder 210 can be controlled.
The information on the differential time used to control the timing of the data output is independent of the number of bytes of the data stored in storage unit 248B. Therefore, even if the number of bytes of the data stored in storage unit 248B fluctuates due to the fluctuation in bit rate like VBR, data output unit 256 can output the data stored in storage unit 248B to decoder 210 at correct timing. That is, the effect of outputting the data at correct timing is obtained. That is, advantageously data output unit 256 can accurately control the output speed of the data to be transmitted to decoder 210.
The amount of data outputted from storage unit 244 is the maximum amount of data which does not exceed the empty region of storage unit 248A to which the data is outputted. The amount of data outputted from storage unit 248A is the maximum amount of data which does not exceed the empty region of storage unit 248B to which the data is outputted. Accordingly, the speed at which the data is outputted to decoder 210 can be propagated. That is, when the speed at which the data is outputted to decoder 210 is changed, the speed at which the data is outputted from storage unit 244 is changed accordingly.
As a result, the effect of preventing the generation of overrun or underrun in storage unit 244 is obtained by using the processes of the present embodiment, even if the increase or decrease in data of storage unit 244 due to the time lag between the clocks cannot be monitored with the time stamp value or the number of bytes of the data.
In a present embodiment, an output circuit as still another mode of the present invention will be described in detail. The mode in which the output circuit is incorporated into the receiver in the real-time stream transmission will be described by way of example.
A network system of the present embodiment differs from network system 1000 in that the network system includes transmitter 100B instead of transmitter 100 while including receiver 200B instead of receiver 200. Because other configurations are similar to those of network system 1000, the detailed description is not repeated.
Receiver 200B receives streaming data as packets from transmitter 100B through network 50. The streaming data is streaming data STD 200 of
Then, each process performed inside output circuit 240B will be described in detail. In the present embodiment, the following various processes are simultaneously started and independently performed.
In step S125B, difference monitoring unit 251 notifies output request unit 253 of the information on the computed differential time. Then, the process in step S120 is performed again.
Referring to
In step S321A, output request unit 253 reads the data having the oldest storage time in the plural pieces of data stored in storage unit 248B. It is assumed that the read data is e.g. streaming data STD100 of
In step S323A, output request unit 253 transmits the data output request to data output unit 256. Then, the process in step S320 is performed again.
Referring to
In step S531, output unit 254 refers to the value of the variable buffer_head (see
In step S532, output unit 254 transmits the output notification that the data has been already outputted to storage unit 248A to difference monitoring unit 251. Then, the procedure proceeds to step S533.
In step 533, output unit 254 increases the value of the variable buffer_head by the number of bytes of the data outputted through the process in step S531, which changes the output position of the next data (packet). Then, the process in step S530 is performed again.
Referring to
In step S542, data output unit 256 reads the data stored in storage unit 248B, and transmits the data to decoder 210. Then, the process in step S540 is performed again.
As described above, the same effect as the third embodiment is obtained in the processes performed by output circuit 240B of the fourth embodiment.
In a present embodiment, still another mode of the output circuit will be described.
A network system of the present embodiment differs from network system 1000 in that the network system includes a receiver 200C instead of receiver 200. Because other configurations are similar to those of network system 1000, the detailed description is not repeated.
Output circuit 240C differs from output circuit 240A in that output circuit 240C includes a processing unit 250C instead of processing unit 250. Because other configurations are similar to those of output circuit 240A, the detailed description is not repeated.
Processing unit 250C differs from processing unit 250 of
That is, receiver 200C differs from receiver 200A in that output request unit 253 is provided outside output circuit 240C. Output request unit 253 is configured by hardware. That is, output request unit 253 is an external circuit with respect to output circuit 240C.
In the present embodiment, the processes performed by difference monitoring unit 251, accumulation unit 252, output request unit 253, and output unit 254 are similar to those of the second embodiment, so that the detailed description is not repeated.
Thus, the differential time computed by difference monitoring unit 251 is transmitted (notified) to output request unit 253. In this case, the differential time becomes information for controlling the timing at which output request unit 253 provides the output request.
Accordingly, the same effect as the second embodiment can be obtained by receiver 200C of the present embodiment.
A process in which an external circuit of the output circuit computes the differential time will be described in a present embodiment.
In the present embodiment, because a network system is similar to that of the fifth embodiment, the detailed description is not repeated. Accordingly,
In the present embodiment, because accumulation unit 252 performs the same process (data accumulation process of
Difference monitoring unit 251 performs the processes in steps S120, S121, and S122 of the difference monitoring process of
Difference monitoring unit 251 transmits (notifies) the output time stored through the process in step S123 and the storage time corresponding to the output time to output request unit 253 which is the external circuit.
Output request unit 253 computes the differential time between the received output time and the storage time corresponding to the output time. Since the computation of the differential time is similar to the process in step S124 performed by difference monitoring unit 251, the detailed description is not repeated. In this case, the computed differential time becomes information for controlling the timing at which output request unit 253 provides the output request. That is, the output time and the storage time corresponding to the output time, received by output request unit 253, become the information for controlling the timing at which output request unit 253 provides the output request.
Accordingly, the same effect as the second embodiment can be obtained in receiver 200C of the present embodiment.
Output circuit 240 of the first embodiment and difference monitoring unit 251 in the output circuit of the second to fifth embodiments perform the process of computing the differential time. In the second embodiment, output request unit 253 utilizes the differential time to control the speed at which output unit 254 outputs the data.
In the third embodiment, data output unit 256 utilizes the differential time to control the speed at which the data is outputted. In the fourth embodiment, output request unit 253 utilizes the differential time to control the speed at which data output unit 256 outputs the data. The control of the speed at which each of the second data to fourth data is outputted is one in which the data output speed is increased when the differential time reaches a predetermined upper limit while the data output speed is decreased when the differential time reaches a predetermined lower limit.
However, in the present invention, the following processes may be performed without being limited to the above-described processes.
In this case, A indicating a gradient of the straight line is a value in which the amount of data of the storage unit (buffer) is divided by an observed time. That is, A indicates a time lag of the progress of time between the transmitter and the receiver.
A becomes zero when decoder 210 reproduces the data at the speed at which encoder 110 of the transmitter outputs the data. However, A becomes a numerical value except zero when the time lag in the clock exists between the transmitter and the receiver.
Therefore, correction value H per unit time is set to A in the clock counting process of each embodiment. In each embodiment, using the set correction value, the processing unit (for example, processing unit 250, processing unit 250B, and processing unit 250C) which performs the clock counting process controls the speed at which the processing unit (for example, output unit 254 and data output unit 256) outputs the data to decoder 210.
Through the above-described process, the clock speed of the transmitter and the clock speed of the receiver are brought close to each other as time advances. Accordingly, the effect of preventing the generation of overrun or underrun is obtained.
Although each of the units of the present invention is performed by the same processing unit, the units may be performed by different processing units respectively. For example, the output request unit may be operated on another processing unit to notify the output request unit located on a different processing unit of the differential information obtained by the difference monitoring unit, or a different processing unit may be notified of the storage time and output time to be the basis of the differential computation and compute the difference to provide the output request.
In the present invention, the differential time is computed by the computation of the difference between the time at which the data A is stored in storage unit 244 and the time at which the data A is outputted from storage unit 244. That is, the differential time is computed by focusing on the same data which is the data A. However, the differential time may be computed by the following computation method A.
The computation method A is a method of computing the differential time in the case where predetermined pieces (for example, two) of data are stored in storage unit 244 during a period until the data B is stored in storage unit 244 since the data A is stored in storage unit 244. The predetermined pieces may be zero. It is assumed that time t1 is the time at which the data A is stored in storage unit 244 while time t2 is the time at which the data B is outputted from storage unit 244. In this case, in the computation method A, the differential time is computed by computing the time period corresponding to the difference between time t1 and time t2. That is, the differential time can also be computed by focusing on two different pieces of data.
The differential time may be computed by the following computation method B.
In the computation method B, the value of the clock counter which counts the clock outputted from clock generator 247 is set to zero at the time when the data A is stored in storage unit 244, and the value of the clock counter at the time when the data A is outputted from storage unit 244 is read to compute the differential time. Hereinafter the value of the clock counter is also referred to as the number of clock counts.
The differential time may be computed by a computation method C in which the computation method A and the computation method B are combined. The computation method C is a method of computing the differential time in the case where predetermined pieces (for example, two) of data are stored in storage unit 244 during a period until the data B is stored in storage unit 244 since the data A is stored in storage unit 244. The predetermined pieces may be zero. It is assumed that time t3 is the time at which the data A is stored in storage unit 244 while time t4 is the time at which the data B is outputted from storage unit 244. In this case, in the computation method C, the value of the clock counter is set to zero at the time t3, and the value of the clock counter is read at the time t4 to compute the differential time.
It is noted that the disclosed embodiments are illustrated only by way of example and thus nonrestrictive. The scope of the present invention is determined by not the above descriptions but the appended claims, and obviously it is intended that the present invention include the meanings equivalent to the scope of the claims and modifications and changes within the scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
2005-197865 | Jul 2005 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2006/313230 | 7/3/2006 | WO | 00 | 1/4/2008 |