comparison frtest/max-out.c @ 128:a5ffec18e4cd

test programs: use printf %d format for codec parameters Even though all codec params (both FR and EFR) are small unsigned integers, we use signed int16_t data type for both, for interface reasons: in the case of FR it's the gsm_signal type of libgsm, and in the case of EFR it's the Word16 type of ETSI codec guts. Therefore, the correct printf format is %d, not %u, when the objective is to see what's in the variables (what the compiler sees) and catch any bugs.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 11 Dec 2022 04:00:13 +0000
parents a8fd4ff6b013
children
comparison
equal deleted inserted replaced
127:4af99bf8671a 128:a5ffec18e4cd
73 bfi = 0; 73 bfi = 0;
74 fputs("FR", stdout); 74 fputs("FR", stdout);
75 gsm_explode(dec_state, frame, fr_params); 75 gsm_explode(dec_state, frame, fr_params);
76 n = 0; 76 n = 0;
77 for (i = 0; i < 8; i++) 77 for (i = 0; i < 8; i++)
78 printf(" %u", fr_params[n++]); 78 printf(" %d", fr_params[n++]);
79 putchar('\n'); 79 putchar('\n');
80 for (i = 0; i < 4; i++) { 80 for (i = 0; i < 4; i++) {
81 putchar(' '); 81 putchar(' ');
82 for (j = 0; j < 17; j++) 82 for (j = 0; j < 17; j++)
83 printf(" %u", fr_params[n++]); 83 printf(" %d", fr_params[n++]);
84 putchar('\n'); 84 putchar('\n');
85 } 85 }
86 break; 86 break;
87 default: 87 default:
88 fprintf(stderr, "error: %s is not in FR codec format\n", 88 fprintf(stderr, "error: %s is not in FR codec format\n",
95 gsmfr_preproc_good_frame(pp_state, frame); 95 gsmfr_preproc_good_frame(pp_state, frame);
96 fputs("Xform:", stdout); 96 fputs("Xform:", stdout);
97 gsm_explode(dec_state, frame, fr_params); 97 gsm_explode(dec_state, frame, fr_params);
98 n = 0; 98 n = 0;
99 for (i = 0; i < 8; i++) 99 for (i = 0; i < 8; i++)
100 printf(" %u", fr_params[n++]); 100 printf(" %d", fr_params[n++]);
101 putchar('\n'); 101 putchar('\n');
102 for (i = 0; i < 4; i++) { 102 for (i = 0; i < 4; i++) {
103 putchar(' '); 103 putchar(' ');
104 for (j = 0; j < 17; j++) 104 for (j = 0; j < 17; j++)
105 printf(" %u", fr_params[n++]); 105 printf(" %d", fr_params[n++]);
106 putchar('\n'); 106 putchar('\n');
107 } 107 }
108 gsm_decode(dec_state, frame, pcm); 108 gsm_decode(dec_state, frame, pcm);
109 samp_max = 0; 109 samp_max = 0;
110 for (i = 0; i < 160; i++) { 110 for (i = 0; i < 160; i++) {