OpenCores
URL https://opencores.org/ocsvn/reed_solomon_codec_generator/reed_solomon_codec_generator/trunk

Subversion Repositories reed_solomon_codec_generator

[/] [reed_solomon_codec_generator/] [trunk/] [source/] [RsDecodeDegreeEmulator.cpp] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 issei
//===================================================================
2
// Module Name : RsDecodeDegreeEmulator
3
// File Name   : RsDecodeDegreeEmulator.cpp
4
// Function    : RS Decoder degree emulator
5
// 
6
// Revision History:
7
// Date          By           Version    Change Description
8
//===================================================================
9
// 2009/02/03  Gael Sapience     1.0       Original
10
//
11
//===================================================================
12
// (C) COPYRIGHT 2009 SYSTEM LSI CO., Ltd.
13
//
14
#include <stdio.h>
15
#include <stdlib.h>
16
 
17
 
18
void RsDecodeDegreeEmulator(int *Degree, int *PoynomTab, int TotalSize, int DataSize, int bitSymbol) {
19
 
20
 
21
   //---------------------------------------------------------------
22
   // C++ variables
23
   //---------------------------------------------------------------
24
   int syndromeLength;
25
   int DegreeFlag;
26
   int nonZeroflag;
27
   int ii, jj;
28
   syndromeLength = TotalSize - DataSize;
29
 
30
 
31
   //---------------------------------------------------------------
32
   // compute Degree
33
   //---------------------------------------------------------------
34
   Degree [0]    = 0;
35
   DegreeFlag = 0;
36
 
37
 
38
   for(ii=(syndromeLength-1); ii>=0; ii=ii-1){
39
      nonZeroflag = 0;
40
 
41
      for(jj=0; jj<bitSymbol; jj++){
42
         if (PoynomTab[ii*bitSymbol+jj] !=0) {
43
            nonZeroflag = 1;
44
         }
45
      }
46
 
47
      if ((nonZeroflag == 1) && (DegreeFlag == 0)){
48
         Degree [0]    = ii;
49
         DegreeFlag = 1;
50
      }
51
   }
52
 
53
 
54
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.