Made timing_recovery_cc build

This commit is contained in:
ha7ilm 2017-03-02 12:27:53 +01:00
parent 676e9388fc
commit 2af14b8082
2 changed files with 7 additions and 6 deletions

11
csdr.c
View file

@ -2349,6 +2349,7 @@ int main(int argc, char *argv[])
//fprintf(stderr, "| o"); //fprintf(stderr, "| o");
TRY_YIELD; TRY_YIELD;
} }
}
if(!strcmp(argv[1],"timing_recovery_cc")) //<algorithm> <decimation> [--add_q] if(!strcmp(argv[1],"timing_recovery_cc")) //<algorithm> <decimation> [--add_q]
{ {
@ -2373,13 +2374,13 @@ int main(int argc, char *argv[])
{ {
FEOF_CHECK; FEOF_CHECK;
timing_recovery((complexf*)input_buffer, (complexf*)output_buffer, the_bufsize, &state); timing_recovery((complexf*)input_buffer, (complexf*)output_buffer, the_bufsize, &state);
//fprintf(stderr, "os %d\n",state->output_size); //fprintf(stderr, "os %d\n",state.output_size);
fwrite(output_buffer, sizeof(complexf), state->output_size, stdout); fwrite(output_buffer, sizeof(complexf), state.output_size, stdout);
fflush(stdout); fflush(stdout);
TRY_YIELD; TRY_YIELD;
memmove((complexf*)input_buffer,((complexf*)input_buffer)+state->input_processed,(the_bufsize-state->input_processed)*sizeof(complexf)); //memmove lets the source and destination overlap memmove((complexf*)input_buffer,((complexf*)input_buffer)+state.input_processed,(the_bufsize-state.input_processed)*sizeof(complexf)); //memmove lets the source and destination overlap
fread(((complexf*)input_buffer)+(the_bufsize-state->input_processed), sizeof(complexf), state->input_processed, stdin); fread(((complexf*)input_buffer)+(the_bufsize-state.input_processed), sizeof(complexf), state.input_processed, stdin);
//fprintf(stderr,"iskip=%d state->output_size=%d start=%x target=%x skipcount=%x \n",state->input_processed,state->output_size,input_buffer, ((complexf*)input_buffer)+(BIG_BUFSIZE-state->input_processed),(BIG_BUFSIZE-state->input_processed)); //fprintf(stderr,"iskip=%d state.output_size=%d start=%x target=%x skipcount=%x \n",state.input_processed,state.output_size,input_buffer, ((complexf*)input_buffer)+(BIG_BUFSIZE-state.input_processed),(BIG_BUFSIZE-state.input_processed));
} }
} }

View file

@ -1707,7 +1707,7 @@ int timing_recovery(complexf* input, complexf* output, int input_size, timing_re
current_bitstart_index += num_samples_halfbit * 2 + num_samples_halfbit * (-error/2); current_bitstart_index += num_samples_halfbit * 2 + num_samples_halfbit * (-error/2);
} }
state->input_processed = current_bitstart_index; state->input_processed = current_bitstart_index;
state->output_i = si; state->output_size = si;
} }
} }