FreeCalypso > hg > gsm-codec-lib
view hrutil/dec-parse.c @ 547:f9535c1fbf70
efrtest: new program gsmefr-decode-tw5
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 04 Oct 2024 20:17:36 +0000 |
parents | 2d703e1e9107 |
children |
line wrap: on
line source
/* * This program reads an HRv1 *.dec file in ETSI test sequence format * (decoder input format) and displays its content in human-readable form. */ #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "../libgsmhr1/tw_gsmhr.h" main(argc, argv) char **argv; { char *infname; FILE *inf; int big_endian; unsigned frame_no; int16_t params[GSMHR_NUM_PARAMS_DEC]; int rc; if (argc == 2 && argv[1][0] != '-') { big_endian = 0; infname = argv[1]; } else if (argc == 3 && !strcmp(argv[1], "-b")) { big_endian = 1; infname = argv[2]; } else { fprintf(stderr, "usage: %s [-b] file.dec\n", argv[0]); exit(1); } inf = fopen(infname, "r"); if (!inf) { perror(infname); exit(1); } for (frame_no = 0; ; frame_no++) { rc = read_dec_frame(inf, big_endian, params, infname, frame_no); if (!rc) break; printf("#%u: BFI=%d UFI=%d SID=%d TAF=%d\n", frame_no, params[18], params[19], params[20], params[21]); print_frame_params(params); } exit(0); }