1. Field of the Invention
The present invention relates generally to audio/video systems and methods and, more particularly, to different ways to control audio rate adjustment that prevents underflow or overflow.
2. Introduction
In an MPEG audio/video system, the MPEG transport stream is transmitted from the head end (via either cable or satellite). The decoder in the receiver derives its timing (time base) from the MPEG transport stream program clock reference (PCR) and uses it as its display timing. This ensures that the display timing is locked to the incoming MPEG transport stream, thereby providing a stable system with no audio/video data underflow or overflow. Details of the MPEG system are provided in ISO/IEC 13818-1, which is incorporated herein by reference in its entirety.
One example of an MPEG audio/video decoder system is shown in
In MPEG dual real-time audio/video systems, there is a desire to display audio in a time base that is different from its source. For example, in a TV that has picture-in-picture (PIP) capability, the user might choose to switch the audio from the main audio to the PIP audio or vice versa without switching the corresponding video. When the user chooses main audio along with the main video, the display time base matches the audio source time base and the audio system is stable with no overflow or underflow of audio data. This is the scenario illustrated in
A system and/or method to control the audio rate adjustment, substantially as shown in and/or described in connection with at least one of the figures, as set forth more completely in the claims.
In order to describe the manner in which the above-recited and other advantages and features of the invention can be obtained, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
Various embodiments of the invention are discussed in detail below. While specific implementations are discussed, it should be understood that this is done for illustration purposes only. A person skilled in the relevant art will recognize that other components and configurations may be used without parting from the spirit and scope of the invention.
Displaying audio data in a time base that is different from its source leads to potential underflow or overflow conditions. In accordance with the present invention, a control mechanism for audio rate adjustment is provided that prevents either of these conditions from occurring. In a dual real-time audio/video system two audio/video decoders are used. Each of these two audio/video decoders would include a transport processor that generates a time base that controls a display timing of audio for that particular transport stream. For example, a first transport processor in a first audio/video decoder could generate a first time base for a main audio display, while a second transport processor in a second audio/video decoder could generate a second time base for a PIP audio display. If a user switches the audio display from the main audio to the PIP audio without switching the main video, then the PIP audio samples would not be displayed in accordance with the second time base derived from the PIP input transport stream. An underflow or overflow condition could then arise.
To illustrate the features of the present invention, reference is first made to the flowchart of
In one embodiment, this adjustment mechanism is based on the removing or adding of one or more decoded audio samples. Removal of decoded audio samples can occur when a smaller number of samples are displayed as compared to the number being made available for display. Addition of decoded audio samples, on the other hand, can occur when a greater number of samples are displayed as compared to the number being made available for display.
In one embodiment, the additional samples can be based on a simple technique such as duplication. In more complex embodiments, the addition of samples can be based on the blending of other samples.
In one embodiment, control of audio rate adjustment is performed through a comparison of the source and display time base. More specifically, the source and the display time bases are compared to calculate the rate difference. Adjustments are then made to match the source audio rate with the display rate. To facilitate a comparison, both the source and the display time bases are converted to the same unit (i.e., sample rate), which facilitates the comparison. Any identified differences between the two rates can then be used to add or drop audio samples such that the source rate will match the display rate.
Each audio/video decoder's display rate locks to its input transport stream, thereby ensuring that no audio/video data overflow or underflow will occur. More specifically, transport processor 310 generates time base A from transport stream A, and transport processor 340 generates time base B from transport stream B. For MPEG transport streams, time base A and time base B can be derived from the PCR contained in the respective transport streams.
In this dual decoder arrangement, it is desired to display the PIP audio produced by audio decoder 354 on main audio display 326, while continuing to display the main video produced by video decoder 334 on main video display 336. In conventional audio/video decoder systems, main audio display 326 would display the PIP audio in accordance with time base A, which is derived from the main display input transport stream. This display arrangement can lead to underflow or overflow in the PIP audio since the PIP audio is being displayed in accordance with a time base different from the PIP source.
As is further illustrated in
Main audio display 326 and PIP audio display 356 output audio samples in accordance with an audio sample rate clock. PIP audio display 356 outputs PIP audio samples in accordance with an audio sample rate clock that is generated by audio NCO 352. Audio NCO 352 generates the audio sample rate clock based on time base B and FS_B.
While PIP audio display 356 is dedicated to the output of PIP audio samples, main audio display 326 can output either main audio samples or PIP audio samples. As illustrated, main audio display 326 outputs audio samples that are chosen by selector 384. Selector 384 receives main audio samples from main audio decoder 324 and PIP audio samples from PIP audio decoder 354 via rate adjustment module 370. The operation of the control for rate adjustment module 370 is described in greater detail below.
Selector 384 chooses the audio samples generated by main audio decoder 324 when main audio display 326 displays the main audio. When PIP audio is to be displayed by main audio display 326, then selector 384 would choose the PIP audio samples received via rate adjustment module 370.
To facilitate the display of PIP audio by main audio display 326, a suitable sample rate clock for the PIP audio is also made available to main audio display 326. As illustrated, the sample rate clock is generated by audio NCO 386 using time base A and FS_B. In other words, audio NCO 386 generates a sample rate clock using the audio sample rate of PIP transport stream B, but in the time base derived from main transport stream A. The generated sample rate clock generated by audio NCO 386 is made available to selector 382, which is designed to select the appropriate sample rate clock for use by audio display 326.
When main audio is displayed on main audio display 326, selector 382 would select the sample rate clock generated by audio NCO 322 and selector 384 would select the audio samples generated by audio decoder 324. When PIP audio is displayed on main audio display 326, selector 382 would select the sample rate clock generated by audio NCO 386 and selector 384 would select the rate adjusted audio samples generated by rate adjustment module 370. In the embodiment of
As illustrated, the sample rate clock generated by audio NCO 386, which is locked to main transport stream A, and the sample rate clock generated by audio NCO 352, which is locked to the PIP transport stream B, are applied to increment and decrement inputs, respectively, of counter 372. Any mismatch between these two input sample rate clocks is used to make a PIP audio data rate adjustment to match the PIP audio data rate to the main audio display rate. A simple increment/decrement counter 372 can be used for this purpose. In operation, the main audio display sample rate is used to increment counter 372 while the PIP audio sample rate is used to decrement counter 372.
If the PIP audio sample rate matches the main audio display rate, then counter 372 will hover around the value of zero. In this case, the PIP audio sample rate matches the main audio display rate and no rate adjustment is needed. However, if the PIP audio sample rate is faster then the main audio display rate, the counter 372 will decrement and have a negative value. This scenario is representative of the condition where the PIP audio samples are being made available by PIP audio decoder 354 at a faster rate than is being displayed by main audio display 326. If the negative value of counter 372 is determined by threshold comparator 374 to be lesser than a negative value of a programmable threshold, then a PIP audio sample is dropped by rate adjustment module 378. This rate adjustment removes a PIP audio sample so that the PIP audio sample rate matches the main audio display rate. At the same time as the dropping of the PIP audio sample, counter 372 is also incremented to account for the dropped sample.
Similarly, if the PIP audio sample rate is slower than the main audio display rate, then counter 372 will increment. If this value is determined by threshold comparator 376 to be greater than a positive value of a programmable threshold, then a PIP audio sample should be added by rate adjustment module 378. This scenario is representative of the condition where the PIP audio samples are being made available by PIP audio decoder 354 at a slower rate than is being displayed by main audio display 326. This adjustment adds a PIP audio sample so that the PIP audio sample rate matches the main audio display rate. At the same time as the adding of the PIP audio sample, counter 372 is also decremented to account for the added sample.
In one embodiment, rate adjustment module 378 can be designed to repeat audio samples or drop audio samples. In an alternative embodiment, rate adjustment module 378 can be designed to use blending of PCM data to add or drop samples to improve sound quality during a rate adjustment.
It should be noted that in the embodiment of
In another embodiment, the control of rate adjustment can be performed by considering the system time clock (STC), presentation time stamp (PTS), and the display rate. In this process, the three parameters STC, PTS and display rate can be used to calculate the rate difference between the source and display time bases.
In an MPEG system, an audio frame with a PTS is displayed when the STC=PTS. STC is normally locked to the input transport stream, which is the source time base. Thus, between any two consecutive PTSs (i.e., T period interval), there should be a fixed number (Y) of audio samples to be displayed. During this T period interval, it is assumed that the number of audio samples displayed is Z. If Y=Z, then the source rate and display rate match. If Z<Y, then one or more audio samples should be dropped to match the source rate to the display rate. If Z>Y, then one or more audio samples should be added to match the source rate to the display rate.
Each audio/video decoder's display rate locks to its input transport stream. More specifically, transport processor 410 generates time base A from transport stream A, and transport processor 440 generates time base B from transport stream B.
In this dual decoder arrangement, PIP audio display can display PIP audio samples based on a sample rate clock derived from PIP transport stream A or main transport stream B. This choice of sample rate clock is enabled via selector 454.
If it is desired to display the PIP audio while continuing to display the main video produced by video decoder 454 on main video display 456, then the display of PIP audio is in accordance with the sample rate clock generated by audio NCO 442 from main transport stream B. As illustrated in
To prevent underflow or overflow of PIP audio samples when displayed in accordance with a sample rate clock generated from main transport stream B, rate adjustment of the PIP audio samples is needed. This rate adjustment is effected via rate adjustment module 464, which is under control of rate analysis module 462. In one embodiment, rate analysis module 464 is embodied in firmware using processor control.
In operation, rate analysis module would consider the parameters STC, PTS and the display rate to calculate the rate difference between the source and display time bases. When a PTS is equal STC, Y number of PCM samples is produced from decoding compressed audio data. During the time period T between any two consecutive PTSs, from the STC=current PTS to STC=next PTS, the audio display will consume Z samples. Rate analysis module 462 then determines if Z−Y is greater than or less than zero. If Z−Y is greater than zero, then rate analysis module 462 would instruct rate adjustment module 464 to add Z-Y audio samples to match the source rate to the display rate. If Z−Y is less than zero, then rate analysis module 462 would instruct rate adjustment module 464 to drop Y−Z audio samples to match the source rate to the display rate. In one embodiment, the calculation of Z can be based on the amount of data in the display FIFO when STC=PTS.
These and other aspects of the present invention will become apparent to those skilled in the art by a review of the preceding detailed description. Although a number of salient features of the present invention have been described above, the invention is capable of other embodiments and of being practiced and carried out in various ways that would be apparent to one of ordinary skill in the art after reading the disclosed invention, therefore the above description should not be considered to be exclusive of these other embodiments. Also, it is to be understood that the phraseology and terminology employed herein are for the purposes of description and should not be regarded as limiting.
Number | Name | Date | Kind |
---|---|---|---|
6714826 | Curley et al. | Mar 2004 | B1 |
7006152 | Demas et al. | Feb 2006 | B2 |
7084898 | Firestone et al. | Aug 2006 | B1 |
7502073 | Umesako | Mar 2009 | B2 |
7558462 | Kurita | Jul 2009 | B2 |
20020150126 | Kovacevic | Oct 2002 | A1 |
20040233938 | Yamauchi | Nov 2004 | A1 |
20050175322 | Demas et al. | Aug 2005 | A1 |
20060176963 | Barthel et al. | Aug 2006 | A1 |
20060248559 | Michener et al. | Nov 2006 | A1 |
20070258706 | Raskar et al. | Nov 2007 | A1 |
Number | Date | Country | |
---|---|---|---|
20080091437 A1 | Apr 2008 | US |