This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2007-069176, filed Mar. 16, 2007, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to a contents reproducing apparatus capable of reproducing video or audio data transmitted by transport stream.
2. Description of the Related Art
In a terrestrial digital broadcasting (for example, “one-segment broadcasting” in Japan) received by a 3G (3rd Generation) cellular telephone, video data is encoded in H. 264/AVC and audio data is encoded in MPEG-2 AAC. The encoded video data and audio data as called “elementary stream (ES)” are multiplexed on the transport stream in MPEG-2 SYSTEMS as a packetized elementary stream packet (PES packet) and then transmitted. Transport stream packets (TS packets) are aligned in the transport stream. A TS packet can store attribute information indicating the attribute of a bit stream composing video and audio data, a bit stream, and reference clock information called a program clock reference (PCR) for synchronizing between media such as video and audio data. The transport stream is transmitted in the wireless or wired fashion.
On the receiving side, the received TS packets are recorded. If the TS packets include the PCR, the PCR is set on a system time clock (STC) counter which counts the STC to synchronize the clock on the receiving side with the transmitting side. More specifically, the STC is adjusted (clock recovery) on the basis of a result of comparison between a value obtained by sampling the PCR in 27 MHz and the STC value on the receiving side. On the receiving side, if the STC value counted by the STC counter is equal to or greater than a presentation time stamp (PTS) included in the PES packets, the ES in the PES packets is synchronized and reproduced. In addition, a normal reproduction mode of sequentially decoding and reproducing the video and audio data in the TS packets received from the broadcast wave is known as the contents reproduction mode. Furthermore, a time shift reproduction mode of preliminarily storing the received TS packets in a buffer (time shift storing mode) when the user cannot see or hear, and sequentially decoding and reproducing the video and audio data in the TS packets stored in the buffer while storing the TS packets received from the broadcast wave in the buffer in the receiving order when the user becomes capable of see and hear, is also known.
A method of reproducing the stored data in synchronization with the STC on the transmitting side is proposed in Jpn. Pat. Appln. KOKAI Publication No. 2002-15527. More specifically, the stored data is synchronized with the STC of the transmitting side by adding the receiving time of the TS packets as the time information on storing the received TS packets, and by referring to the time information at the time of reproducing the stored data.
In the time shift reproduction mode, if the STC of the transmitting side and the receiving side cannot be synchronized and if the STC of the receiving side is later than the STC of the transmitting side, the buffer may overflow and the time shift reproduction may be broken since the amount of the data stored in the buffer continues greater than the amount of the decoded and reproduced data. In addition, even if the clock recovery is performed in the time shift reproduction mode, the PCR included in the TS packets cannot be used as an effective value for the clock recovery since the video and audio data as actually decoded and reproduced are included in the TS packets received in the time shift storing mode. In other words, normally performing the clock recovery in the time shift reproduction mode is difficult. In addition, the receiving time of the TS packets is added as the time information at the time of storing the TS packets in the method of Jpn. Pat. Appln. KOKAI Publication No. 2002-15527, but the overflow still may occur in the buffer since the data needs to be decoded and reproduced simultaneously with the data storage in the time shift reproduction mode.
The object of the present invention is to provide a contents reproducing apparatus capable of synchronous reproduction with the transmitting side even in the time shift reproduction mode.
According to an aspect of the invention, there is provided a contents reproducing apparatus, comprising: a receiving unit configured to receive a first packet having an elementary stream in which encoded video or audio data is stored, and a second packet having the elementary stream and a program clock reference; a counter configured to count a system time clock and output the counted system time clock as a system time clock value; a first buffer configured to store the first and second packets in an order of reception in a time shift reproduction mode and a time shift storage mode to pre-store the first and second packets prior to the time shift reproduction mode; a correcting unit configured to correct the program clock reference included in the second packet received by the receiving unit by using the system time clock value and output the corrected program clock reference, in the time shift reproduction mode; a control unit configured to control the system time clock in accordance with the corrected program clock reference and the system time clock value, in the time shift reproduction mode; a second buffer configured to temporarily store the elementary stream included in the first and second packets stored in the first buffer, in the time shift reproduction mode; a decoder configured to decode the video or audio data from the elementary stream stored in the second buffer, at a timing determined in accordance with the system time clock value; and a reproducing unit configured to reproduce the video or audio data.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.
Embodiments of the present invention will be described below with reference to the accompanying drawings.
As shown in
If the contents reproducing apparatus is the cellular phone, another antenna, a modem circuit for receiving radio signal from a base station and transmitting radio signal to the base station via the antenna, signal processing circuit for decoding the radio signal transferred from the modem circuit, and a speech codec are needed for usual voice communication.
A broadcast wave transmitted from a broadcasting station is received by the antenna 101 and transferred to the tuner 102. The tuner 102 selects a channel to be reproduced from the broadcast wave received by the antenna 101. A transport stream transmitted on the channel selected by the tuner 102 is temporarily stored by unit of TS packet in the broadcast wave buffer 124.
When a predetermined number of TS packets are recorded in the broadcast wave buffer 124, the TS I/F 103 generates an interrupt signal to the input control unit 106 to input the TS packets in the syntax analysis unit 107. The predetermined number may be, for example, 1 here but may be a different value in accordance with the equipment of the contents reproducing apparatus. If the input control unit 106 switches the switch 122 to the TS I/F 103 by the interrupt signal, the TS I/F 103 transfers the predetermined number of TS packets to the syntax analysis unit 107 via the switch 122. A method of transferring the predetermined number of TS packets is not limited here but, for example, a method of further preparing a buffer for the predetermined number of TS packets, copying the TS packets in the buffer, and retrieving the copied TS packets by the syntax analysis unit 107 may be provided. In addition, the syntax analysis unit 107 may access the broadcast wave buffer 124 and directly retrieve the TS packets.
The reproduction mode input unit 104 notifies the reproduction mode control unit 105 of change in the reproduction mode of the contents reproducing apparatus. In the contents reproducing apparatus shown in
The change of the reproduction mode is made under user's directions such as key operations or the like or, if the contents reproducing apparatus is a mobile radio terminal, by events such as call-in or the like. More specifically, if the user cannot watch or listen to the video and audio data while the contents reproducing apparatus is reproducing contents in the normal reproduction mode, the instruction for change of the reproduction mode is input to the reproduction mode input unit 104, by the key operation or the like for changing the reproduction mode to the time shift storage mode. Then, if the user becomes capable of starting watching and listening again, the instruction for change of the reproduction mode is input to the reproduction mode input unit 104, by the key operation or the like for changing the reproduction mode from the time shift storage mode to the time shift reproduction mode or normal reproduction mode. In a case where processes of filtering, decoding and reproducing all the TS packets stored in the buffer 109 are completed (various kinds of processes catch up the broadcast wave) by the user's operation such as fast play or the like while the contents reproducing apparatus is reproducing contents in the time shift reproduction mode, the contents reproducing apparatus automatically shifts from the time shift reproduction mode to the normal reproduction mode, since the currently received broadcast wave are to be reproduced. If the contents reproducing apparatus is a mobile radio terminal, the reproduction mode may be automatically shifted to the time shift storage mode, since the user does not become watching or listening to the video and audio data while speech communication.
The reproduction mode control unit 105 notifies the input control unit 106, PID filter 108 and STC control unit 111 of the current reproduction mode, and changes the switch 123 on the basis of the current reproduction mode. In other words, if the contents reproducing apparatus becomes in the normal reproduction mode, the reproduction mode control unit 105 changes the switch 123 such that the PCR included in the TS packet of the broadcast wave is input to the STC control unit 111. If the contents reproducing apparatus shifts to the time shift reproduction mode, the reproduction mode control unit 105 changes the switch 123 such that the PCR corrected by the correction unit 110 is input to the STC control unit 111. If the contents reproducing apparatus is in the time shift storage mode, the control of the switch 123 is not particularly limited due to no input to the STC control unit 111.
The input control unit 106 changes the switch 122 on the basis of the interrupt signal from the TS I/F 103 and the notification of the reproduction mode from the reproduction mode control unit 105. In other words, if the input control unit 106 receives from the reproduction mode control unit 105 a notification that the stream reproducing apparatus is in the normal reproduction mode or time shift storage mode, the input control unit 106 changes the switch 122 such that the TS packet transferred from the TS I/F 103 is input to the syntax analysis unit 107. In addition, if the input control unit 106 receives from the reproduction mode control unit 105 a notification that the stream reproducing apparatus is in the time shift reproduction mode, the input control unit 106 changes the switch 122 such that the TS packet stored in the buffer 109 is input to the syntax analysis unit 107. However, when the interrupt signal is input from the TS I/F 103, the switch 122 is once changed to input the TS packet transferred from the TS I/F 103 to the syntax analysis unit 107, and the switch 122 is changed again to the buffer 109 side. Furthermore, the input control unit 106 notifies the correction unit 110 of whether the TS packet input to the syntax analysis unit 107 is the TS packet transferred from the TS I/F 103 or the TS packet stored in the buffer 109.
The syntax analysis unit 107 analyzes each syntax from the TS packet transferred via the switch 122 and transfers the TS packet to the PID filter 108. In particular, the syntax analysis unit 107 analyzes the syntaxes included in TS header, adaptation field and PES header in the TS packet.
As shown in
As shown in
Further, a TS header includes a 1-bit transport error indicator which shows whether a TS packet includes an error, and a 2-bit length adaptation field control indicating the presence or absence of an adaptation field or payload. Here, as an adaptation field control, “11” is defined as “an adaptation field exists, and payload exists”, “10” is defined as “an adaptation field exists, and a payload does not exist”, “01” is defined as “an adaptation field does not exist, and a payload exists”, and “00” is defined as “RFU (Reserved for Future Use)”, respectively.
A TS header also has a sync byte indicating the beginning of the TS packet. A TS header also has a payload unit start indicator, which informs the decoder that a new PES packet starts from a payload in the TS packet. A TS header also has a transport priority indicating the importance of the TS packet, and a 2-bit length transport scrambling control indicating the presence or absence of a scramble of a payload in the TS packet. A TS header also has a 4-bit length continuity counter for detecting whether some of TS packets having the same PID are discarded halfway.
As shown in
As shown in
As shown in
In accordance with the PID included in the TS header in the TS packet transferred from the syntax analysis unit 107, The PID filter 108 assigns the TS packet. More specifically, the PID filter 108 assigns the TS packet in accordance with the PID, by referring to table information called program map table (PMT) included in each program. In other words, by retrieving the PMT by using the PID as a key, the PID filter 108 obtains information that, for example, the TS packet includes the video data or audio data, and then discriminates destination of the assigned TS packet. If the program to be viewed is changed by the user's operation or the like, the PMT of the changed program is reset in the PID filter 108. The destination of the assigned TS packet discriminated by the PID filter 108 is also changed in the reproduction mode notified by the reproduction mode control unit 105.
In a case where the contents reproducing apparatus is in the normal reproduction mode, the PID filter 108 transmits the TS packet to the PES extraction unit 114 if the video data is included in the TS packet and transmits the TS packet to the PES extraction unit 118 if the audio data is included in the TS packet. If the TS packet includes the PCR, the PID filter 108 assigns the PCR to the STC control unit 111. If the PID filter 108 cannot retrieve the PID of the TS packet from the PMT, the PID filter 108 abandons the TS packet.
In a case where the contents reproducing apparatus is in the time shift storage mode, the PID filter 108 transfers the TS packet to the buffer 109. At this time, if the PID filter 108 cannot retrieve the PID of the TS packet from the PMT, the PID filter 108 may preliminarily abandon the TS packet.
In a case where the contents reproducing apparatus is in the time shift reproduction mode, if the TS packet is a TS packet transferred from the TS I/F 103, the PID filter 108 transfers the TS packet to the buffer 109. At this time, if the TS packet includes the PCR, the PID filter 108 assigns the PCR to the STC control unit 111. In a case where the TS packet is a TS packet transferred from the buffer 109, the PID filter 108 transmits the TS packet to the PES extraction unit 114 if the video data is included in the TS packet or transmits the TS packet to the PES extraction unit 118 if the audio data is included in the TS packet. In addition, in a case where the TS packet includes the PCR, the PID filter 108 assigns the PCR to the STC control unit 111. If the PID filter 108 cannot retrieve the PID of the TS packet from the PMT, the PID filter 108 abandons the TS packet.
The buffer 109 stores the TS packet from the broadcast wave in a case where the contents reproducing apparatus is in the time shift storage mode or the time shift reproduction mode. In the following descriptions, the buffer 109 is a ring buffer and has a leading pointer indicating the leading address of the stored data and an end pointer indicating the end address of the stored data. In other words, the buffer 109 stores the TS packet in the order from the leading part as shown in
The correction unit 110 corrects the PCR assigned by the PID filter 108 in a case where the contents reproducing apparatus is in the time shift reproduction mode. More specifically, the correction unit 110 first discriminates whether or not the STC 112 stops. For example, the correction unit 110 discriminates the stop of the STC 112 by receiving a notification of restart of the STC 112 from the STC control unit 111 or referring to the STC value counted by the STC counter 113, or on the basis of the other information.
If the STC 112 has not yet been started, when the correction unit 110 first receives the PCR included in the TS packet transferred from the buffer 109, the correction unit 110 notifies the STC control unit 111 of the PCR via the switch 123. The STC control unit 111 restarts the STC 112 after loading the PCR into the STC counter 113.
If the STC 112 has been restarted, the correction unit 110 corrects the PCR included in the TS packet transferred from the TS I/F 103 and notifies the STC control unit 111 of the corrected PCR via the switch 123. The correction of the PCR is performed in the following manner.
When the correction unit 110 first receives the PCR included in the TS packet transferred from the TS I/F 103 after the restart of the STC 112, the correction unit 110 calculates a difference between the PCR and the current STC value as ΔPCR. After that, every time the correction unit 110 receives the PCR included in the TS packet transferred from the TS I/F 103, the correction unit 110 notifies the STC control unit 111 of a value obtained by subtracting ΔPCR from the PCR as the corrected PCR, via the switch 123.
A technical significance of correcting the PCR by the correction unit 110 will be described below with reference to
If the PCR is not corrected by the correction unit 110, the STC 112 cannot synchronize with the transmitting side since the STC control unit 111 cannot obtain a valid PCR and perform the clock recovery. Therefore, as shown in
On the other hand, if the PCR is corrected by the correction unit 110, the STC 112 can synchronize with the transmitting side since the STC control unit 111 can perform the clock recovery by using the corrected PCR. Therefore, occurrence of the overflow in the buffers 115 and 119 can be prevented. More specifically, the correction unit 110 corrects the PCR as shown in
In
In
The STC control unit 111 compares the PCR input via the switch 123 with the STC value from the STC counter 113. The STC control unit 111 controls the STC 112 to raise the frequency if the STC value is smaller than the PCR, or controls the STC 112 to lower the frequency if the STC value is greater than the PCR. When the STC control unit 111 receives from the input control unit 106 a notification that the reproduction mode of the contents reproducing apparatus has been changed to the time shift storage mode, the STC control unit 111 stops the STC 112. When the STC control unit 111 receives from the input control unit 106 a notification that the reproduction mode of the contents reproducing apparatus has been changed to the time shift reproduction mode, the STC control unit 111 restarts the STC 112. However, if a part of the TS packet stored in the buffer 109 is overwritten and lost as described above, the STC control unit 111 restarts the STC 112 after loading the initial PCR stored in the buffer 109 into the STC counter 113 as an initial value.
The STC 112 generates the STC on the basis of the frequency determined by the STC control unit 111, and inputs the STC in the STC counter 113.
The STC counter 113 inputs the STC value counted by the STC 112 in the decoders 116 and 120. The STC value is also input in the STC control unit 111 for the clock recovery.
The PES extraction unit 114 extracts the PES packet having the video ES transmitted from the PID filter 108, and transfers the PES packet to the buffer 115. The buffer 115 temporarily stores the PES packet extracted by the PES extraction unit 114.
The decoder 116 obtains the PES packet from the buffer 115 at the timing determined on the basis of the STC value from the STC counter 113, decodes the ES in the PES packet, and obtains the video data. The display unit 117 reproduces the video data decoded by the decoder 116.
The PES extraction unit 118 extracts the PES packet having the audio ES transferred from the PID filter 108, and transfers the PES packet to the buffer 119. The buffer 119 temporarily stores the PES packet extracted by the PES extraction unit 118.
The decoder 120 obtains the PES packet from the buffer 119 at the timing determined on the basis of the STC value from the STC counter 113, decodes the ES in the PES packet, and obtains the audio data. The speaker 121 reproduces the audio data decoded by the decoder 120.
The switch 122 changes the input of the syntax analysis unit 107 on the basis of the control signal from the input control unit 106. In other words, either the TS packet stored in the buffer 109 or the TS packet transferred from the TS I/F 103 is input to the syntax analysis unit 107.
The switch 123 changes the input of the STC control unit 111 on the basis of the control signal from the reproduction mode control unit 105. In other words, either the PCR included in the TS packet of the general broadcast wave or the PCR corrected by the correction unit 110 is input to the STC control unit 111.
The time shift reproducing operation of the contents reproducing apparatus according to the embodiment of the present invention will be described below with reference to a flowchart shown in
When the reproduction mode control unit 105 receives from the reproduction mode input unit 104 an instruction for shifting to the time shift reproduction, the contents reproducing apparatus starts the time shift reproduction. First, it is discriminated whether or not the buffer 109 is overwritten. The process proceeds to step S202 if the buffer 109 is not overwritten or proceeds to step S203 if the buffer 109 is overwritten (step S201). In step S202, the STC control unit 111 restarts the STC 112. The process proceeds to step S203.
In step S203, it is discriminated whether or not the time shift reproduction is ended. More specifically, end of the time shift reproduction is discriminated by detecting, for example, whether the leading address of the stored data in the buffer 109 has caught up with the end address. When the time shift reproduction is ended, the contents reproducing apparatus ends the time shift reproduction and shifts to the normal reproduction mode. When the time shift reproduction is continued, the syntax analysis unit 107 inputs the TS packet from the TS I/F 103 or the buffer 109 (step S204). Next, the syntax analysis unit 107 analyzes the syntax of the input TS packet and transfers the TS packet to the PID filter 108 (step S205). The PID filter 108 discriminates whether or not the PID of the TS packet is set, by referring to the PMT (step S206). If the PID is not present in the PMT, the process returns to step S203 since the TS packet is not a TS packet to be processed. If the PID is present in the PMT, the process proceeds to step S207.
In step S207, the PID filter 108 discriminates whether or not the TS packet to be processed includes the PCR. If the TS packet includes the PCR, the process proceeds to step S208. If the TS packet does not include the PCR, the process proceeds to step S217. In step S208, the PID filter 108 discriminates whether or not the TS packet to be processed is transferred from the TS I/F 103. If the TS packet to be processed is transferred from the TS I/F 103, the process proceeds to step S209. If the TS packet to be processed is not transferred from the TS I/F 103, the process proceeds to step S214.
In step S209, it is discriminated whether or not the STC 112 has restarted. If the STC 112 has restarted, the process proceeds to step S210. If the STC 112 has not restarted, the process proceeds to step S217. In step S210, it is discriminated whether or not the correction unit 110 has calculated ΔPCR. If ΔPCR has been calculated, the process proceeds to step S212. If ΔPCR has not been calculated, the process proceeds to step S211. In step S211, the correction unit 110 calculates ΔPCR. In other words, the correction unit 110 obtains ΔPCR by subtracting the STC value of the STC counter 113 from the transferred PCR, and the process proceeds to step S212. In step S212, the correction unit 110 subtracts ΔPCR from the transferred PCR and sets the subtraction result as the corrected PCR. Next, the correction unit 110 notifies the STC control unit 111 of the PCR corrected in step S212, and the process proceeds to step S217 (step S213).
In step S214, it is discriminated whether or not the buffer 109 is overwritten before the start of the time shift reproduction mode. In other words, the same discrimination as that described in step S201 is performed. If the buffer 109 is overwritten, the process proceeds to step S215. If the buffer 109 is not overwritten, the process proceeds to step S217. In step S215, it is discriminated whether or not the PCR is a PCR first transferred from the buffer 109 after the start of the time shift reproduction mode. If the PCR is the first PCR, the process proceeds to step S216. If the PCR is not the first PCR, the process proceeds to step S217. In step S216, the PCR is loaded into the STC counter 113, the STC control unit 111 restarts the STC 112, and the process proceeds to step S217.
In step S217, it is discriminated whether or not the TS packet is transferred from the TS I/F 103. In other words, the same discrimination as that described in step S208 is performed. If the TS packet is transferred from the TS I/F 103, the process proceeds to step S218. If the TS packet is not transferred from the TS I/F 103, the process proceeds to step S219. In step S218, the TS packet is stored in the buffer 109, and the process returns to step S203.
In step S219, it is discriminated whether or not the STC 112 has restarted. In other words, the same discrimination as that described in step S209 is performed. If the STC 112 has restarted, the process proceeds to step S220. If the STC 112 has not restarted, the process returns to step S203. In step S220, the process of reproducing the TS packet is performed and the process returns to step S203. More specifically, the video and audio data obtained by extracting the PES packet from the TS packet and decoding the PES packet are reproduced.
In the above-described embodiment, the PCR from the broadcast wave is corrected and the clock recovery is performed by using the corrected PCR, in the time shift reproduction mode. Therefore, the contents reproducing apparatus capable of reproduction synchronous with the transmitting side even in the time shift reproduction mode can be provided.
Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
For example, both the video data and the audio data can be reproduced but either the video data or the audio data may be reproduced. In other words, if the video data alone is reproduced, the PES extraction unit 118, the buffer 119, the decoder 120, and the speaker 121 may be removed from the contents reproducing apparatus shown in
The present invention can be otherwise variously modified within a scope which does not depart from the gist of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2007-069176 | Mar 2007 | JP | national |