- for (state = 0; state < NUM_STATE; state++) {
- uint32_t bitcost = ((uint32_t) (s0 ^ ao_fec_decode_table[(state<<1)]) +
- (uint32_t) (s1 ^ ao_fec_decode_table[(state<<1)+1]));
- {
- uint32_t cost0 = cost[p][state] + bitcost;
- uint8_t state0 = ao_next_state(state, 0);
-
- if (cost0 < cost[n][state0]) {
- cost[n][state0] = cost0;
- bits[n][state0] = (bits[p][state] << 1) | (state & 1);
- }
- }
- {
- uint32_t cost1 = cost[p][state] + 510 - bitcost;
- uint8_t state1 = ao_next_state(state, 1);
-
- if (cost1 < cost[n][state1]) {
- cost[n][state1] = cost1;
- bits[n][state1] = (bits[p][state] << 1) | (state & 1);
- }
- }
+#define DO_STATE(state) { \
+ uint32_t bitcost = ((uint32_t) (s0 ^ ao_fec_decode_table[(state<<1)]) + \
+ (uint32_t) (s1 ^ ao_fec_decode_table[(state<<1)+1])); \
+ { \
+ uint32_t cost0 = cost[p][state] + bitcost; \
+ uint8_t state0 = ao_next_state(state, 0); \
+ \
+ if (cost0 < cost[n][state0]) { \
+ cost[n][state0] = cost0; \
+ bits[n][state0] = (bits[p][state] << 1) | (state & 1); \
+ } \
+ } \
+ { \
+ uint32_t cost1 = cost[p][state] + 510 - bitcost; \
+ uint8_t state1 = ao_next_state(state, 1); \
+ \
+ if (cost1 < cost[n][state1]) { \
+ cost[n][state1] = cost1; \
+ bits[n][state1] = (bits[p][state] << 1) | (state & 1); \
+ } \
+ } \