2016-06-22 16:45:29 -04:00
|
|
|
// qra65_subs.c
|
|
|
|
// Fortran interface routines for QRA65
|
|
|
|
|
|
|
|
#include "qra65.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void qra65_enc_(int x[], int y[])
|
|
|
|
{
|
|
|
|
int ncall=0xf70c238; //K1ABC
|
|
|
|
qra65codec *codec = qra65_init(0,ncall); //codec for ncall
|
|
|
|
qra65_encode(codec, y, x);
|
|
|
|
}
|
|
|
|
|
2016-06-24 15:54:34 -04:00
|
|
|
void qra65_dec_(float r[], int* nmycall, int xdec[], int* rc)
|
2016-06-22 16:45:29 -04:00
|
|
|
{
|
2016-06-23 09:58:18 -04:00
|
|
|
// Return codes:
|
2016-06-24 15:54:34 -04:00
|
|
|
// rc=-16 failed sanity check
|
|
|
|
// rc=-2 decoded, but crc check failed
|
|
|
|
// rc=-1 no decode
|
2016-06-23 09:58:18 -04:00
|
|
|
// rc=0 [? ? ?] AP0 (decoding with no a-priori information)
|
|
|
|
// rc=1 [CQ ? ?] AP27
|
2016-06-24 15:54:34 -04:00
|
|
|
// rc=2 [CQ ? ] AP42
|
2016-06-23 09:58:18 -04:00
|
|
|
// rc=3 [CALL ? ?] AP29
|
2016-06-24 15:54:34 -04:00
|
|
|
// rc=4 [CALL ? ] AP44
|
2016-06-23 09:58:18 -04:00
|
|
|
// rc=5 [CALL CALL ?] AP57
|
|
|
|
|
2016-06-24 15:54:34 -04:00
|
|
|
static int ncall0=0;
|
|
|
|
int ncall;
|
|
|
|
int x[63],y[12];
|
|
|
|
|
|
|
|
ncall = *nmycall;
|
2016-06-22 16:45:29 -04:00
|
|
|
qra65codec *codec = qra65_init(1,ncall); //codec for ncall
|
2016-06-24 15:54:34 -04:00
|
|
|
/*
|
|
|
|
if(ncall != ncall0) {
|
|
|
|
memset(y,0,sizeof(y));
|
|
|
|
qra65_encode(codec, y, x);
|
|
|
|
printf("Updated codec %d\n",ncall);
|
|
|
|
}
|
|
|
|
ncall0=ncall;
|
|
|
|
*/
|
2016-06-22 16:45:29 -04:00
|
|
|
*rc = qra65_decode(codec,xdec,r);
|
|
|
|
}
|