projects
/
debian
/
gnuradio
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 3.2.2
[debian/gnuradio]
/
gr-trellis
/
src
/
lib
/
trellis_viterbi_b.cc
diff --git
a/gr-trellis/src/lib/trellis_viterbi_b.cc
b/gr-trellis/src/lib/trellis_viterbi_b.cc
index e30f51388ac38bf8e6e3c39874421a6cc5d500e5..ead61b197a111b7cbc80bfcd4c23a022b2a2dae1 100644
(file)
--- a/
gr-trellis/src/lib/trellis_viterbi_b.cc
+++ b/
gr-trellis/src/lib/trellis_viterbi_b.cc
@@
-6,7
+6,7
@@
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version
2
, or (at your option)
+ * the Free Software Foundation; either version
3
, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
@@
-20,6
+20,8
@@
* Boston, MA 02110-1301, USA.
*/
* Boston, MA 02110-1301, USA.
*/
+// WARNING: this file is machine generated. Edits will be over written
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@
-77,8
+79,8
@@
trellis_viterbi_b::forecast (int noutput_items, gr_vector_int &ninput_items_requ
void viterbi_algorithm(int I, int S, int O,
const std::vector<int> &NS,
const std::vector<int> &OS,
void viterbi_algorithm(int I, int S, int O,
const std::vector<int> &NS,
const std::vector<int> &OS,
- const std::vector<
int
> &PS,
- const std::vector<
int
> &PI,
+ const std::vector<
std::vector<int>
> &PS,
+ const std::vector<
std::vector<int>
> &PI,
int K,
int S0,int SK,
const float *in, unsigned char *out)//,
int K,
int S0,int SK,
const float *in, unsigned char *out)//,
@@
-106,9
+108,9
@@
void viterbi_algorithm(int I, int S, int O,
for(int j=0;j<S;j++) { // for each next state do ACS
minm=INF;
minmi=0;
for(int j=0;j<S;j++) { // for each next state do ACS
minm=INF;
minmi=0;
- for(
int i=0;i<I
;i++) {
- int i0 = j*I+i;
- if((mm=alpha[alphai*S+PS[
i0]]+in[k*O+OS[PS[i0]*I+PI[i0
]]])<minm)
+ for(
unsigned int i=0;i<PS[j].size()
;i++) {
+
//
int i0 = j*I+i;
+ if((mm=alpha[alphai*S+PS[
j][i]]+in[k*O+OS[PS[j][i]*I+PI[j][i
]]])<minm)
minm=mm,minmi=i;
}
trace[k*S+j]=minmi;
minm=mm,minmi=i;
}
trace[k*S+j]=minmi;
@@
-132,9
+134,9
@@
void viterbi_algorithm(int I, int S, int O,
}
for(int k=K-1;k>=0;k--) { // traceback
}
for(int k=K-1;k>=0;k--) { // traceback
- int i0=
st*I+
trace[k*S+st];
- out[k]= (unsigned char) PI[i0];
- st=PS[i0];
+ int i0=trace[k*S+st];
+ out[k]= (unsigned char) PI[
st][
i0];
+ st=PS[
st][
i0];
}
}
}
}