BRIEF DESCRIPTION OF THE DRAWINGS
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
FIG. 1 is a block diagram of a conventional data decoder.
FIG. 2 is a waveform diagram of sliced input signals in a noiseless transmission environment.
FIG. 3 is a waveform diagram of input signal Sin and threshold level Sth in a noisy transmission environment.
FIGS. 4
a and 4b show error correction schemes of teletext compliant with WST system.
FIG. 5 is a block diagram of an exemplary data decoder of the invention.
FIGS. 6
a,
6
b, and 6c are waveform diagrams with ambiguous data compensation, incorporating data encoder 5 in FIG. 5.
FIGS. 7
a and 7b are block diagrams of two exemplary threshold level generators incorporated in slicer 54 in FIG. 5.
FIG. 8 is a flowchart of an exemplary decoding method incorporating data decoder 5 in FIG. 5.
FIG. 9 is another block diagram of an exemplary data decoder of the invention.
FIGS. 1
a, b, and c are waveform diagrams, slicing data with multiple threshold levels, incorporating data decoder 9 in FIG. 9.
FIG. 11 is a flowchart of an exemplary decoding method incorporating data decoder 9 in FIG. 9.
FIG. 12 is yet another block diagram of an exemplary data decoder of the invention.
FIG. 13 is a flowchart of an exemplary decoding method incorporating data decoder 12 in FIG. 12.
DETAILED DESCRIPTION OF THE INVENTION
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
FIG. 5 is a block diagram of an exemplary bitstream decoder of the invention, comprising SYNC separator 10, line counter 12, slicer 54, Serial to Parallel converter 56, and bitstream check and correction module 58. SYNC separator 10 is coupled to line counter 12, slicer (comparator) 54, Serial to Parallel converter 56, and subsequently to bitstream check and correction module 58.
SYNC separator 10 receives input signal Sin to separate horizontal and vertical synchronization signals HSYNC and VSYNC for output to line counter 12, enabling slicer 54 (comparator) based thereon. Input signal Sin may be a television broadcast signal carrying bitstream D, with an error checking code.
Upon enablement, slicer 54 compares input signal Sin with threshold level Sth to generate first bitstream Ds, such that each bit of first bitstream Ds is one of two possible states, and identifies an ambiguous bit of the first bitstream when input signal Sin is determined as belonging to an ambiguous range. Data Ds may be a teletext bitstream compliant with WST, encoded by an error checking code every 8 bits. The two possible states may be “logic 1” and “logic 0”. Slicer 54 slices input signal Sin according to the frequency of clock_run_in, and determines data bit as “logic 1” if input signal Sin exceeds threshold level Sth, and “logic 1” if input signal Sin is less than threshold level Sth. The ambiguous range includes threshold level Sth, and may be a signal range plus or minus threshold level Sth. Slicer 54 detects data bit of bitstream Ds falling into the ambiguous range to identify the ambiguous bit, and generates 8-bits ambiguous bitstream DAS accordingly. For example, if a second bit of 8-bits bitstream Ds is ambiguous, slicer 54 generates ambiguous bitstream DAS ‘0100 0000’.
Serial to Parallel converter 56 stores 8-bits serial bitstream Ds and ambiguous bitstream DAS in a buffer thereof, converts both into parallel bitstream Dp and DAP, and passes both to data check and correction module 58 (data check module). Because teletext employs two ECC schemes based on the packet number and the data byte, Serial to Parallel converter 56 also delivers packet number CP and number of data byte CB to data check and correction module 58. In WST system, a scan line comprises 42 bytes excluding clock-run-in part and framing code, and the first two in the 42 bytes include magazine and packet number information. Thus Serial to Parallel converter 56 generates packet number CP according to the first two bytes of a scan line, and comprises a data byte counter calculating number of data bytes CB for each packet.
FIGS. 4
a and 4b show error correction schemes of teletext compliant with WST system. FIG. 4a illustrates ECC data format for packet number 0, and the first 10 bytes use Hamming 8/4 ECC, byte 10-41 use odd parity. FIG. 4b is ECC data format for packet number 1˜25, wherein the first 2 bytes use Hamming 8/4 ECC, and bytes 2-41 use odd parity.
Referring back to FIG. 5, data check and correction module 58 evaluates ECC of data Dp to determine accuracy, inverts the ambiguous bit to the other possible state to generate inverted bitstream, if the ECC evaluation indicates bitstream Dp is erroneous, and outputs bitstream Dp as output bitstream Dout otherwise. Data check and correction module 58 then performs another ECC check on the inverted bitstream, outputs the bitstream Dp if the inverted bitstream is erroneous, and outputs the inverted bitstream otherwise. Data check and correction module 58 performs odd parity or Hamming 8/4 check based on packet number CP and number of bitstream byte CB, as indicated in FIGS. 4a and 4b.
Threshold level Sth may be fixed or adaptive according to amplitude of input signal Sin. FIGS. 7a and 7b are block diagrams of two exemplary threshold level generators incorporated in slicer 54 in FIG. 5. The threshold level generator in FIG. 7a comprises gate 540a and average amplitude generator 542a. Gate 540a detects and outputs amplitude of clock_run_in part in input signal Sin to average amplitude generator 542a, thereby averaging the amplitude to generate threshold level Sth. The threshold level generator in FIG. 7b comprises gate 540b, MAX amplitude detector 542b, MIN amplitude detector 544b, and average amplitude generator 546b. Gate 540b detects and outputs amplitude of clock_run_in to MAX amplitude detector 542b and MIN amplitude detector 544b, determining and outputting the maximum and minimum amplitudes to average amplitude generator 546b, thereby averaging the maximum and minimum amplitudes to generate threshold level Sth.
FIG. 6
a is a waveform diagram with ambiguous bitstream compensation, incorporating bitstream encoder 5 in FIG. 5, odd parity ECC, and fixed threshold level Sth. Ambiguous range Ramb is a fixed range with respect to threshold level Sth, and comprises upper limit SH and lower limit SL. If input signal Sin is less than upper limit SH or exceeds lower limit SL, slicer 54 determines input signal Sin is in ambiguous range Ramb, and generates a “logic 1” indicating the ambiguous bit in ambiguous bitstream DAS. If input signal Sin is outside ambiguous range Ramb, slicer 54 generates a “logic 0” in ambiguous bitstream DAS. In FIG. 6a, the third bit of bitstream Ds falls into ambiguous range Ramb, and slicer 54 generates bitstream Ds ‘1010 1100’ and ambiguous bitstream DAS ‘0010 0000’ to Serial to Parallel converter 56, both converted to parallel bitstream Dp and DAP accordingly. The parity check in data check and correction module 58 indicates bitstream Dp is erroneous, thus bitstream Dp is XORed with bitstream DAP to provide inverted bitstream DSC ‘1000 1100’, errorless by another parity check according thereto. Thus bitstream slicer 5 outputs inverted bitstream DSC as output bitstream Dout.
FIG. 6
b shows a waveform diagram with ambiguous bitstream compensation, incorporating the bitstream encoder in FIG. 5, Hamming 8/4 ECC, and fixed threshold level Sth. Slicer 54 generates bitstream Ds ‘1000 0010’ and DAP ‘0001 0000’, converted to parallel bitstream Dp and DAP in Serial to Parallel converter 56. Data check and correction module 58 determines bitstream Dp after Hamming 8/4 evaluation, such that XORing bitstream Dp with bitstream DAP provides inverted bitstream DSC ‘1001 0010’, errorless according to another Hamming 8/4 evaluation. Data slicer 5 outputs inverted bitstream DSC as output bitstream Dout.
FIG. 6
c is a waveform diagram with ambiguous bitstream compensation, incorporating bitstream encoder 5 in FIG. 5, odd parity ECC, and adaptive threshold level Sth. Threshold level Sth is adaptive according to bitstream part of input signal Sin, and ambiguous range Ramb is fixed with respect to adaptive threshold level Sth.
FIG. 8 is a flowchart of an exemplary decoding method incorporating bitstream slicer 5 in FIG. 5. In step S800, slicer 54 determines slicing frequency and threshold level Sth according to clock_run_in during initialization. Next in step S802, slicer 54 compares input signal Sin with threshold level Sth to generate bitstream Ds, each bit of bitstream Ds being one of two possible states, and identifying ambiguous bitstream DAP when input signal Sin is determined as belonging to the ambiguous range. After converting to parallel bitstream Dp and ambiguous bitstream DAP in Serial to Parallel converter 56, data check and correction module 58 evaluates bitstream Dp according to the ECC type thereof in step S804, outputs parallel bitstream Dp as output bitstream Dout if the ECC evaluation is errorless (step S810), and inverts the ambiguous bit to the other possible state by XORing bitstream Dp and DAP and producing inverted bitstream DSC, if the ECC evaluation is erroneous (step S806). Then in step S808, data check and correction module 58 again evaluates inverted bitstream DSC according to the ECC type thereof, outputs inverted bitstream DSC as output bitstream Dout if the ECC evaluation is errorless (step S812), and outputs original bitstream Dp otherwise (step S810). Decoding method 8 continues to decode input signal Sin by steps S802˜S812, until the process is terminated.
FIG. 9 is another block diagram of an exemplary bitstream slicer of the invention, comprising SYNC separator 10, line counter 12, slicer 94, Serial to Parallel converter 96, and bitstream check and correction module 98. SYNC separator 10 is coupled to line counter 12, slicer 94, Serial to Parallel converter 96, and subsequently to bitstream check and correction module 98.
Data slicer 9 is identical to bitstream slicer 5, except bitstream slicer 9 generates high bitstream DHS and low bitstream DLS with high threshold level SthH and low threshold level SthL to compensate ambiguous bitstream nearby main threshold level Sth. Slicer 94 compares input signal Sin with main threshold level Sth, high threshold level SthH, and low threshold level SthL to generate serial main bitstream DMS, high bitstream DHS, and low bitstream DLS, where each bit of bitstream DMS, DHS, DLS is one of two possible states.
Serial to parallel converter 96 stores serial bitstream DMS, DHS, DLS in a buffer therein, and converts and outputs serial bitstream DMS, DHS, DLS to parallel bitstream DMP, DHP, DLP.
Data check and correction module 98 evaluates ECC of bitstream DMP to determine accuracy, if main bitstream DMP is erroneous, evaluates whether high bitstream DHP is erroneous according to the corresponding error checking code, and outputs main bitstream DMP as output bitstream Dout otherwise. If high bitstream DHP is erroneous, bitstream check and correction module 98 further evaluates whether low bitstream DLP is erroneous according to the corresponding correction code, and outputs high bitstream DHP as output bitstream Dout if ECC evaluation is correct. And finally, if low bitstream DLP is correct, bitstream check and correction module 98 outputs low bitstream DLP as output bitstream Dout, otherwise outputs original bitstream DMP. Data check and correction module 58 performs odd parity or Hamming 8/4 check based on packet number CP and number of bitstream bytes CB, as indicated in FIGS. 4a and 4b.
FIGS. 10
a, b, and c are waveform diagrams slicing bitstream with multiple threshold levels, incorporating data slicer 9 in FIG. 9.
FIG. 10
a incorporates odd parity ECC and fixed threshold level Sth. Slicer 94 generates main bitstream DMS ‘1010 1100’, high bitstream DHS ‘1000 1100’, and low bitstream DLS ‘1010 1100’ with main threshold level Sth, high threshold level SthH, and low threshold level SthL. Data check and correction module 98 performs parity check on main bitstream DMS, bitstream DMS is erroneous, and therefore performs another parity check on high bitstream DHS. Because the parity check of high bitstream DHS is errorless, Data check and correction module 98 outputs high bitstream DHP as output bitstream Dout.
FIG. 10
b incorporates Hamming 8/4 ECC and fixed threshold level Sth. Slicer 94 generates main bitstream DMS ‘1010 1100’, high bitstream DHS ‘1000 1100’, and low bitstream DLS ‘1010 1100’ with main threshold level Sth, high threshold level SthH, and low threshold level SthL. Data check and correction module 98 evaluates Hamming 8/4 ECC based on main bitstream DMS, bitstream DMS is erroneous, and therefore evaluates another Hamming 8/4 ECC based on high bitstream DHS. Because the parity check of high bitstream DHS is correct, Data check and correction module 98 outputs high bitstream DHP as output bitstream Dout.
FIG. 10
c incorporates parity check ECC and adaptive threshold level Sth. Threshold level Sth is adaptive according to bitstream part of input signal Sin, the distance between high threshold level SthH and adaptive threshold level Sth is fixed, as is the distance between high threshold level SthH and adaptive threshold level Sth. Slicer 94 generates main bitstream DMS ‘1010 1100’, high bitstream DHS ‘1000 1100’, and low bitstream DLS ‘1010 1100’ with main threshold level Sth, high threshold level SthH, and low threshold level SthL. Data check and correction module 98 performs parity check on main bitstream DMS, bitstream DMS is erroneous, and therefore performs another parity check on high bitstream DHS. Because the parity check of high bitstream DHS is correct, Data check and correction module 98 outputs high bitstream DHP as output bitstream Dout.
FIG. 11 is a flowchart of an exemplary decoding method incorporating data slicer 9 in FIG. 9. In step S1100, slicer 94 determines slicing frequency and threshold level Sth according to clock_run_in during initialization. Next in step S1102, slicer 94 compares input signal Sin with main threshold level Sth, high threshold level SthH, and low threshold level SthL to generate serial main bitstream DMS, high bitstream DHS, and low bitstream DLS, each bit of bitstream DMS, DHS, and DLS being one of two possible states. After converting to parallel bitstream DMP, DHP, and DLP in Serial to Parallel converter 96, data check and correction module 98 evaluates bitstream DMP according to the ECC type thereof in step S1104, outputs main bitstream DMP as output bitstream Dout if the ECC evaluation is errorless (step S1118), and evaluates ECC of high bitstream DHP if the ECC evaluation of bitstream DMP is erroneous (step S1108). Data check and correction module 98 outputs high bitstream DHP as output bitstream Dout if high bitstream DHP is errorless (step S1110), and further evaluates ECC of low bitstream DLS otherwise (step S1114). In step S1116, data check and correction module 98 outputs low bitstream DLS as output bitstream Dout if ECC evaluation thereof is correct, and outputs the original main bitstream DMS otherwise. Decoding method 11 continues to decode input signal Sin by steps S1102˜S1118, until the process is terminated.
FIG. 12 is yet another block diagram of an exemplary data slicer of the invention, comprising SYNC separator 10, line counter 12, slicer 124, Serial to Parallel converter 126, and data check and correction module 128. SYNC separator 10 is coupled to line counter 12, slicer 124, Serial to Parallel converter 126, and subsequently to data check and correction module 128.
Data slicer 12 combines the ambiguous range in data slicer 5 and multiple threshold levels in data slicer 9 to compensate ambiguous bitstream near main threshold level Sth. Slicer 124 compares input signal Sin with main threshold level Sth, high threshold level SthH, and low threshold level SthL to generate serial main bitstream DMS, high bitstream DHS, and low bitstream DLS, where each bit of bitstream DMS, DHS, DLS is one of two possible states.
Serial to parallel converter 126 stores serial bitstream DMS, DHS, DLS in a buffer therein, and converts and outputs serial bitstream DMS, DHS, DLS to parallel bitstream DMP, DHP, DLP.
Serial to parallel converter 126 performs XOR to bitstream DHP and DLP to generate inverted bitstream DAP, and outputs which to data check and correction module 128.
Data check and correction module 128 evaluates ECC of bitstream DMP to determine accuracy, and outputs bitstream DMP as output bitstream Dout if bitstream DMP is correct. Data check and correction module 128 then performs another ECC check on inverted bitstream DAP, further evaluates ECC of multiple threshold levels (high bitstream DHP or low bitstream DLP) if inverted bitstream DAP is erroneous, and outputs inverted bitstream DAP otherwise. Next Data check and correction module 128 performs yet another ECC check on the bitstream of multiple threshold levels, evaluates ECC of the other multiple threshold level if the bitstream is erroneous, and outputs the correct bitstream otherwise.
FIG. 13 is a flowchart of an exemplary decoding method incorporating data slicer 12 in FIG. 12. In step S1300, slicer 124 determines slicing frequency and threshold level Sth according to clock_run_in during initialization. Next in step S1302, slicer 124 compares input signal Sin with main threshold level Sth, high threshold level SthH, and low threshold level SthL to generate serial main bitstream DMS, high bitstream DHS, and low bitstream DLS, each bit of bitstream DMS, DHS, and DLS is one of two possible states. After converting to parallel bitstream DMP, DHP, and DLP, and XORing DHP and DLP to form inverted bitstream DAP (step S1306) in Serial to Parallel converter 126, data check and correction module 128 evaluates validity of bitstream DMP according to the ECC type thereof in step S1304, outputs main bitstream DMP as output bitstream Dout if the ECC evaluation is errorless (step S1318), otherwise evaluates ECC of inverted bitstream DAP (step S1308). Data check and correction module 128 outputs inverted bitstream DAP as output bitstream Dout if inverted bitstream DAP is errorless (step S1310), and further evaluates ECC of the multiple threshold level bitstream (high bitstream DHP or low bitstream DLP) otherwise (step S1314). In step S1316, bitstream check and correction module 128 outputs the multiple threshold level bitstream as output bitstream Dout if ECC evaluation thereof is correct, and outputs the original main bitstream DMS otherwise. Decoding method 13 continues to decode input signal Sin by steps S1302˜S1318, until the process is terminated.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.