summarylogtreecommitdiffstats
path: root/gmfsk.patch
blob: b5bd0152d679b669444a835e2f37d78f1e916ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
diff --git a/src/misc/misc.c b/src/misc/misc.c
index 14b1320..8bd3f59 100644
--- a/src/misc/misc.c
+++ b/src/misc/misc.c
@@ -103,25 +103,6 @@ guint8 rbits8(guint8 w)
 /* ---------------------------------------------------------------------- */
 
 /*
- * Integer base-2 logarithm
- */
-guint log2(guint x)
-{
-	int y = 0;
-
-	x >>= 1;
-
-	while (x) {
-		x >>= 1;
-		y++;
-	}
-
-	return y;
-}
-
-/* ---------------------------------------------------------------------- */
-
-/*
  * Gray encoding and decoding (8 bit)
  */
 guint8 grayencode(guint8 data)
diff --git a/src/misc/misc.h b/src/misc/misc.h
index 083de73..6a9cf30 100644
--- a/src/misc/misc.h
+++ b/src/misc/misc.h
@@ -105,25 +105,6 @@ extern inline guint8 rbits8(guint8 w)
 /* ---------------------------------------------------------------------- */
 
 /*
- * Integer base-2 logarithm
- */
-extern inline guint log2(guint x)
-{
-	int y = 0;
-
-	x >>= 1;
-
-	while (x) {
-		x >>= 1;
-		y++;
-	}
-
-	return y;
-}
-
-/* ---------------------------------------------------------------------- */
-
-/*
  * Gray encoding and decoding (8 bit)
  */
 extern inline guint8 grayencode(guint8 data)
diff --git a/src/olivia/mfsk.h b/src/olivia/mfsk.h
index 288bed3..4d5f28c 100644
--- a/src/olivia/mfsk.h
+++ b/src/olivia/mfsk.h
@@ -1960,7 +1960,7 @@ template <class Type=float>
 
    Type *ModulatorOutput;
 
-   RateConverter<Type> RateConverter; // output rate converter
+   RateConverter<Type> xRateConverter; // output rate converter
 
    Type *ConverterOutput;
 
@@ -1982,7 +1982,7 @@ template <class Type=float>
        Encoder.Free();
        Modulator.Free();
        free(ModulatorOutput); ModulatorOutput=0;
-	   RateConverter.Free();
+	   xRateConverter.Free();
        free(ConverterOutput); ConverterOutput=0; }
 
    // set default primary parameters
@@ -2027,8 +2027,8 @@ template <class Type=float>
        if(ReallocArray(&ModulatorOutput,Modulator.SymbolSepar)<0) goto Error;
 
        // preset the rate converter
-       RateConverter.OutputRate=OutputSampleRate/SampleRate;
-	   if(RateConverter.Preset()<0) goto Error;
+       xRateConverter.OutputRate=OutputSampleRate/SampleRate;
+	   if(xRateConverter.Preset()<0) goto Error;
 
        MaxOutputLen=(size_t)ceil(Modulator.SymbolSepar*OutputSampleRate/SampleRate+2);
        if(ReallocArray(&ConverterOutput,MaxOutputLen)<0) goto Error;
@@ -2046,7 +2046,7 @@ template <class Type=float>
 	   Monitor.Reset();
        SymbolPtr=0;
        State=0;
-	   RateConverter.Reset(); }
+	   xRateConverter.Reset(); }
 
    Type BaudRate(void)
    { return SampleRate/Modulator.SymbolSepar; }
@@ -2102,7 +2102,7 @@ template <class Type=float>
 	   { Modulator.Send(Encoder.OutputBlock[SymbolPtr]);
          SymbolPtr+=1; if(SymbolPtr>=SymbolsPerBlock) SymbolPtr=0; }
        int ModLen=Modulator.Output(ModulatorOutput);
-	   int ConvLen=RateConverter.Process(ModulatorOutput,ModLen,ConverterOutput);
+	   int ConvLen=xRateConverter.Process(ModulatorOutput,ModLen,ConverterOutput);
        if(ConvLen<0) return ConvLen;
        ConvertToS16(ConverterOutput,Buffer,ConvLen);
 	   return ConvLen; }
@@ -2209,7 +2209,7 @@ template <class Type=float>
 
   private:
 
-   RateConverter<Type> RateConverter;
+   RateConverter<Type> xRateConverter;
 
    Seq<Type> InputBuffer;
 
@@ -2267,7 +2267,7 @@ template <class Type=float>
            DecodePipe[Idx].Free();
          free(DecodePipe); DecodePipe=0; }
 
-       RateConverter.Free();
+       xRateConverter.Free();
        InputBuffer.Free();
        InputProcessor.Free();
        Demodulator.Free();
@@ -2305,8 +2305,8 @@ template <class Type=float>
        BitsPerSymbol=Log2(Tones);
        Tones=Exp2(BitsPerSymbol);
 
-       RateConverter.OutputRate=SampleRate/InputSampleRate;
-       if(RateConverter.Preset()<0) goto Error;
+       xRateConverter.OutputRate=SampleRate/InputSampleRate;
+       if(xRateConverter.Preset()<0) goto Error;
 
        Demodulator.BitsPerSymbol=BitsPerSymbol;
        Demodulator.SymbolLen=Exp2(BitsPerSymbol+7-Log2(Bandwidth/125));
@@ -2383,7 +2383,7 @@ template <class Type=float>
    void Reset(void)
      { size_t Idx;
 
-       RateConverter.Reset();
+       xRateConverter.Reset();
 
        InputBuffer.Clear();
 
@@ -2458,7 +2458,7 @@ template <class Type=float>
    // process an audio batch: first the input processor, then the demodulator
    template <class InpType>
     int Process(InpType *Input, size_t InputLen)
-     { if(RateConverter.Process(Input, InputLen, InputBuffer)<0) return -1;
+     { if(xRateConverter.Process(Input, InputLen, InputBuffer)<0) return -1;
        ProcessInputBuffer();
 	   return 0; }