# Patent

## Title
Efficient chien search method in reed-solomon decoding, and machine-readable recording medium including instructions for executing the method

## Abstract

An efficient Chien search method in Reed-Solomon decoding is adapted to be implemented in a processor having a parallel processing instruction set. The method includes the following steps: (a) calculating an error evaluation value; (b) subjecting the error evaluation value to mapping processing so as to find an index adjusting value; (c) storing a symbol index into an error location memory corresponding to a location index; (d) updating the location index according to the index adjusting value; (e) updating the symbol index; and (f) repeating steps (a) to (e) a particular number of times. The method primarily aims to reduce program flow branching so as to enhance the computation efficiency of the Chien search process.

## Background
CROSS-REFERENCE TO RELATED APPLICATION
This application claims priority of Taiwanese Application No. 096122733, filed on Jun. 23, 2007.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The invention relates to a Chien search method in Reed-Solomon decoding, more particularly to a Chien search method in Reed-Solomon decoding, which can reduce program flow branching so as to enhance efficiency, and to a machine-readable recording medium including a plurality of instructions for executing the method.
2. Description of the Related Art
In recent years, demand for reliable signal transmission with respect to products ranging from consumer electronic products to communications electronic products has increased considerably. Therefore, error detection and correction mechanisms are becoming more and more important. During the process of digital communication, to ensure the accuracy of source data to be transmitted, a transmitting end generally will append redundant data to the source data, so that the receiving end can perform error correction based on the redundant data. The Reed-Solomon code is a widely used correction code. Since the Reed-Solomon code has a good correction capability with respect to errors generated in transmission channels, it has become a very popular channel coding scheme, and is now a widely used error correction code in satellite communication systems, digital television systems, various digital audiovisual recording media, etc.
Even though the Reed-Solomon code has excellent performance in error correction, the amount of computations required for decoding is huge. Consequently, hardware is often used for calculation and processing. If the Reed-Solomon code is executed in a processor in the form of program decoding, the decoding speed will inevitably become extremely slow due to the huge computation amount. Therefore, in some applications of communications devices with software-defined operations (such as software defined radio (SDR)), accelerating the program decoding speed of the Reed-Solomon code has become an important subject of research.
Referring to FIG. 1, an existing Reed-Solomon decoding procedure can be divided into four stages, which are, as shown, a stage 11 of calculating syndromes, a stage 12 of calculating error location polynomials, a stage 13 of executing a Chien search, and a stage 14 of calculating error values. In this Reed-Solomon decoding procedure, about 40% of the computation amount is concentrated on the Chien search at stage 13. If the processing time for executing the Chien search can be effectively reduced, the decoding speed of the Reed-Solomon code can be successfully accelerated.
Referring to FIG. 2, a conventional Chien search method in Reed-Solomon decoding includes the following steps. In step 21, a location index j and a symbol index i are initialized, i.e., j=0, and i=0. In step 22, an error evaluation value Λ(αi) is calculated. In step 23, a decision is performed to determine if the error evaluation value Λ(αi) is equal to 0. If yes, this indicates that an error occurs in a symbol at the ith position, and step 24 is carried out to perform the necessary processing. Otherwise, the flow goes to the processing in step 26. In steps 24 and 25, the current symbol index i is first stored in an error location array, Location[j]=1, followed by incrementing the location index, j=j+1. In steps 26-28, a decision is performed to determine if the Chien search has been completed, i.e., determining if i=n−1. If yes, the Chien search is ended. Otherwise, the symbol index i is incremented, i=i+1, and the aforesaid steps 22-26 are repeated. In steps 24-25, n represents a total number of symbols of a Reed-Solomon block code that was received.
The determination processing in step 23 of the aforesaid conventional method will generate program flow branching. That is, one operation (step 24) will be executed when Λ(αi)=0, and another operation (step 26) will be executed when Λ(αi)≠0. Branching will result in disordered execution of a processor, causing a reset of internal instructions and data of a pipeline of the processor, thereby affecting the overall efficiency of the processor adversely.
Other conventional Chien search schemes in the Reed-Solomon code, such as those disclosed in U.S. Pat. No. 6,263,470 and U.S. Pat. No. 6,360,348, are primarily concerned with the acceleration of the computation of the Chien search process using look-up tables, and are silent on the problem of program flow branching associated with the Chien search process.
Therefore, there is a need for a solution to reduce the program flow branching in the aforesaid conventional method, so that the processing time of the Chien search can be further reduced to thereby increase the decoding speed of the Reed-Solomon code.
SUMMARY OF THE INVENTION
Therefore, an object of the present invention is to provide an efficient Chien search method in Reed-Solomon decoding, which is adapted to be implemented in a processor having a parallel processing instruction set.
Accordingly, the efficient Chien search method in Reed-Solomon decoding of the present invention includes the following steps: (a) calculating an error evaluation value; (b) subjecting the error evaluation value to mapping processing so as to find an index adjusting value; (c) storing a symbol index into an error location memory corresponding to a location index; (d) updating the location index according to the index adjusting value; (e) updating the symbol index; and (f) repeating steps (a) to (e) a particular number of times.
Another object of the present invention is to provide a machine-readable recording medium adapted for execution of the efficient Chien search method in Reed-Solomon decoding.
Accordingly, the machine-readable recording medium of the present invention includes a plurality of instructions. The instructions are used to execute the following steps in a processor having a parallel processing instruction set: (a) calculating an error evaluation value; (b) subjecting the error evaluation value to mapping processing so as to find an index adjusting value; (c) storing a symbol index into an error location memory corresponding to a location index; (d) updating the location index according to the index adjusting value; (e) updating the symbol index; and (f) repeating steps (a) to (e) a particular number of times.
The present invention allows for a further reduction in the processing time of the Chien search process by reducing program flow branching in the Chien search, thereby enhancing the decoding speed of the Reed-Solomon code.



BRIEF DESCRIPTION OF THE DRAWINGS
Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which:
FIG. 1 is a flow diagram to illustrate a conventional Reed-Solomon decoding procedure;
FIG. 2 is a flowchart to illustrate a conventional Chien search method in Reed-Solomon decoding;
FIG. 3 is a flowchart to illustrate a preferred embodiment of an efficient Chien search method in Reed-Solomon decoding according to the present invention; and
FIG. 4 is a schematic diagram to illustrate mapping processing in the preferred embodiment.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
Referring back to FIG. 1, as mentioned hereinbefore, the Reed-Solomon decoding procedure includes stages 11, 12, 13, and 14. In stage 11, the purpose of calculating syndromes is to determine if the received signal has been contaminated by noise. If the result of syndrome calculation is 0, this indicates that the signal has not been contaminated (i.e., the received signal is correct). Otherwise, processing in stages 12 to 14 must be continued. In stage 12, a Berlekamp-Massey algorithm is used to calculate an error location polynomial. In stage 13, a Chien search is conducted according to the error location polynomial to find at least one error evaluation value. The error evaluation value can be used to confirm the location of the error. In stage 14, at least one error value is found, and the error value is subtracted at an appropriate error location so as to recover the correct signal.
In general, a Reed-Solomon block code is represented by Reed-Solomon (n,k), where n represents the total number of symbols of each block after encoding, k represents the number of source message symbols of each encoded block, and t=(n−k)/2, t representing the maximum number of correctable errors. For example, a digital video broadcasting (DVB) system of the European specification adopts Reed-Solomon (204,188). That is, there are altogether 204 symbols in the Reed-Solomon block code, the number of encoded source message symbols is 188, and the maximum number of correctable errors is 8.
Suppose the Reed-Solomon block code received is as expressed in the following Equation (1):

r=r0+r1+r2+ . . . +ri+ . . . +ra−1  (1)

where i is a symbol index, and ri represents the ith symbol in the Reed-Solomon block code.

Using the Berlekamp-Massey algorithm, the number of symbols in which errors occur, and an error location polynomial can be found. Supposing there are altogether d symbols in which errors occur, the error location polynomial thus calculated is as expressed in the following Equation (2):

Λ(αi)=λ0+λ1α1+λ2α2i+λ3α3i+ . . . +λdαdi  (2)

where d≦t.

For each symbol ri, a corresponding error evaluation value Λ(αi) is calculated. The calculation is expressed in the following Equation (3):




  
    
      
        
          
            
              
                Λ
                ⁡
                
                  (
                  
                    α
                    0
                  
                  )
                
              
              =
              
                
                  λ
                  0
                
                +
                
                  
                    λ
                    1
                  
                  ⁢
                  
                    α
                    0
                  
                
                +
                
                  
                    λ
                    2
                  
                  ⁢
                  
                    α
                    0
                  
                
                +
                
                  
                    λ
                    3
                  
                  ⁢
                  
                    α
                    0
                  
                
                +
                ⋯
                +
                
                  
                    λ
                    d
                  
                  ⁢
                  
                    α
                    0
                  
                
              
            
          
        
        
          
            
              
                Λ
                ⁡
                
                  (
                  
                    α
                    1
                  
                  )
                
              
              =
              
                
                  λ
                  0
                
                +
                
                  
                    λ
                    1
                  
                  ⁢
                  
                    α
                    1
                  
                
                +
                
                  
                    λ
                    2
                  
                  ⁢
                  
                    α
                    2
                  
                
                +
                
                  
                    λ
                    3
                  
                  ⁢
                  
                    α
                    3
                  
                
                +
                ⋯
                +
                
                  
                    λ
                    d
                  
                  ⁢
                  
                    α
                    d
                  
                
              
            
          
        
        
          
            ⋮
          
        
        
          
            
              
                Λ
                ⁡
                
                  (
                  
                    α
                    
                      n
                      -
                      1
                    
                  
                  )
                
              
              =
              
                
                  λ
                  0
                
                +
                
                  
                    λ
                    1
                  
                  ⁢
                  
                    α
                    
                      n
                      -
                      1
                    
                  
                
                +
                
                  
                    λ
                    2
                  
                  ⁢
                  
                    α
                    
                      
                        2
                        ⁢
                        n
                      
                      -
                      2
                    
                  
                
                +
                
                  
                    λ
                    3
                  
                  ⁢
                  
                    α
                    
                      
                        3
                        ⁢
                        n
                      
                      -
                      3
                    
                  
                
                +
                ⋯
                +
                
                  
                    λ
                    d
                  
                  ⁢
                  
                    α
                    
                      d
                      ⁡
                      
                        (
                        
                          n
                          -
                          1
                        
                        )
                      
                    
                  
                
              
            
          
        
      
    
    
      
        (
        3
        )
      
    
  




If the error evaluation value Λ(αi) thus calculated is 0, this indicates that an error has occurred in the symbol ri. Otherwise, this indicates that the symbol ri is correct.
Since the principles of encoding and decoding in the Reed-Solomon code and the finite field operations are constructed on the Galois field GF(2m), where (2m) represents the total number of corresponding elements in the Galois field, the finite field operation for the error evaluation value Λ(αi) in Equation (3) herein is a Galois field operation.
The preferred embodiment of an efficient Chien search method in Reed-Solomon decoding of the present invention can be accomplished using a software program. Therefore, in the present invention, a plurality of instructions are written using a programming language and are stored in a machine-readable recording medium. When the instructions are loaded into a processor having a parallel processing instruction set, the processor can be used to execute the method of the present invention.
In the preferred embodiment, the method is executed in an x86 processor having a SSE2 instruction set. However, the method can also be executed in a digital signal processor (DSP), a general purpose processor, or a central processing unit (CPU) having a similar parallel processing instruction set. Thus, implementation of the present invention should not be limited to the preferred embodiment illustrated herein.
Referring to FIG. 3, an efficient Chien search method in Reed-Solomon decoding of the present invention includes the following steps.
In step 31, a location index j is initialized to 0, i.e., j=0, and the symbol index i is initialized to 0, i.e., i=0.
In step 32, according to Equation (3), the error evaluation value Λ(αi) is found. In the preferred embodiment, p entries of error evaluation values Λ(αi) ̃Λ(αi+(p−1)) are calculated in a single operation using the parallel processing instruction set to perform a vector finite field operation. As techniques relating to vector finite field operations are not crucial features of the present invention, they will not be discussed herein for the sake of brevity. Furthermore, since the p entries of error evaluation values Λ(αi) ̃Λ(αi+(p−1)) can also be obtained through look-up tables disclosed in the prior art (such as U.S. Pat. No. 6,263,470 and U.S. Pat. No. 6,360,348 mentioned hereinabove), implementation of the present invention should not be limited to the preferred embodiment as illustrated herein.
In step 33, the error evaluation value Λ(αi) is subjected to mapping processing to obtain an index adjusting value ei. That is, if the error evaluation value Λ(αi) is 0, the index adjusting value ei is 1, and is 0 if otherwise, as expressed in the following Equation (4):

∀Λ(αi)=0:ei=1

∀Λ(αi)≠0:ei=0  (4).

In the preferred embodiment, p entries of error evaluation values Λ(αi) ̃Λ(αi+(p−1)) are mapped in a single operation using the parallel processing instruction set. Using the SSE2 parallel processing instruction set of the x86 processor as an example, the p(p=16) entries of error evaluation values Λ(αi) ̃Λ(αi+(p−1)) are each compared with 0 at the same time using a pcmpeqb instruction, where if a certain error evaluation value Λ(αi+x) is 0, Λ′(αi+x) is equal to 0xFFh (hexadecimal); otherwise, Λ′(αi+x) is equal to 0. Thereafter, a pand instruction is used to perform an AND operation of each of the p entries of error evaluation values Λ′(αi) ̃Λ′(αi) and 0x01h. As shown in FIG. 4, as a result of the pcmpeqb and pand instructions, p entries of index adjusting values ei ̃ei+(p−1) can be obtained.
Referring to FIG. 3, in step 34, the symbol index i is stored in an error location memory corresponding to the location index j. The error location memory is actually an array, and is assumed to be Location[1×d]. Thus, the processing in step 34 can be expressed as Location[j]=i.
In step 35, the index adjusting value ei is added to the location index j, so as to update the location index j, i.e., j=j+ei.
In step 36, the symbol index i is updated, i.e., i=i+1.
It should be noted that, in this preferred embodiment, the p entries of index adjusting values ei ̃ei+(p−1) are subjected to the processing in steps 34 to 36 in sequence. In other words, after completing the processing in step 33, the processing in steps 34 to 36 is performed in sequence p times. When ei=0, this indicates that the symbol index i will be put in the same memory location, and this is the so-called memory in place technique.
In steps 37 to 38, a decision is performed to determine if the Chien search has been completed. If yes, the flow is ended. Otherwise, steps 32 to 36 are repeated. The number of times steps 32 to 36 are repeated depends on the total number n of symbols in the Reed-Solomon block code. After all the symbols in the Reed-Solomon block code have been processed (when i=n−1), this indicates that the Chien search has been completed.
Referring back to FIG. 2, by utilizing mapping processing of the error evaluation value Λ(αi) and the memory in place technique, the present invention can help avoid program flow branching as a result of the processing in step 23 of the conventional method.
In sum, since the method of the present invention can eliminate the program flow branching problem associated with the Chien search, reduce disordered execution of the processor, and enhance utilization efficiency of the pipeline of the processor, the processing time of the Chien search can be further reduced to successfully increase the decoding speed of the Reed-Solomon code.
While the present invention has been described in connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifications and equivalent arrangements.

## Claims

1. An efficient Chien search method in Reed-Solomon decoding, which is adapted to be implemented in a processor having a parallel processing instruction set, the efficient Chien search method comprising the following steps:
(a) calculating an error evaluation value;
(b) subjecting the error evaluation value to mapping processing so as to find an index adjusting value;
(c) storing a symbol index into an error location memory corresponding to a location index;
(d) updating the location index according to the index adjusting value;
(e) updating the symbol index; and
(f) repeating steps (a) to (e) a particular number of times.

2. The efficient Chien search method according to claim 1, wherein the particular number of times is determined by a total number of symbols in a received Reed-Solomon block code.

3. The efficient Chien search method according to claim 2, wherein, in step (b), the index adjusting value is 1 if the error evaluation value is 0, and the index adjusting value is 0 if otherwise.

4. The efficient Chien search method according to claim 3, wherein, in step (d), the index adjusting value is added to the location index so as to update the location index.

5. The efficient Chien search method according to claim 1, wherein, in step (b), the error evaluation value is subjected to mapping processing by means of the parallel processing instruction set so as to find the index adjusting value.

6. A machine-readable recording medium, which includes a plurality of instructions, the instructions being used to execute the following steps in a processor having a parallel processing instruction set:
(a) calculating an error evaluation value;
(b) subjecting the error evaluation value to mapping processing so as to obtain an index adjusting value;
(c) storing a symbol index into an error location memory corresponding to a location index;
(d) updating the location index according to the index adjusting value;
(e) updating the symbol index; and
(f) repeating steps (a) to (e) a particular number of times.

7. The machine-readable recording medium according to claim 6, wherein the particular number of times is determined by a total number of symbols in a received Reed-Solomon block code.

8. The machine-readable recording medium according to claim 7, wherein, in step (b), the index adjusting value is 1 if the error evaluation value is 0, and the index adjusting value is 0 if otherwise.

9. The machine-readable recording medium according to claim 8, wherein, in step (d), the index adjusting value is added to the location index so as to update the location index.

10. The machine-readable recording medium according to claim 6, wherein, in step (b), the error evaluation value is subjected to mapping processing by means of the parallel processing instruction set so as to find the index adjusting value.