comparison frtest/max-out.c @ 28:a8fd4ff6b013

gsmfr-max-out: dump transformed codec parameters too
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 21 Nov 2022 01:02:07 +0000
parents 896ce7f1d271
children a5ffec18e4cd
comparison
equal deleted inserted replaced
27:896ce7f1d271 28:a8fd4ff6b013
1 /* 1 /*
2 * This program reads an extended-libgsm binary file, dumps every frame in 2 * This program reads an extended-libgsm binary file (which must be in FR
3 * human-readable form just like gsmrec-dump, but then also passes it through 3 * codec format, not EFR) and performs the following processing, in this
4 * our GSM FR decoder (libgsmfrp+libgsm) and looks for the highest-magnitude 4 * order:
5 * PCM sample in the decoder output. This maximum output sample magnitude is 5 *
6 * reported after the dump of each input frame. This program is intended to 6 * 1) dumps every frame in human-readable form just like gsmrec-dump;
7 * serve as a debug aid, for troubleshooting of our libgsmfrp+libgsm stack. 7 * 2) passes the frame stream through our DTX Rx preprocessor;
8 * 3) dumps the output from the preprocessor;
9 * 4) feeds this output to the standard 06.10 decoder (libgsm);
10 * 5) finds the highest-magnitude PCM sample in the decoder output and
11 * reports this maximum output magnitude.
12 *
13 * This program is intended to serve as a debug aid, for troubleshooting
14 * of our libgsmfrp+libgsm stack.
8 */ 15 */
9 16
10 #include <stdio.h> 17 #include <stdio.h>
11 #include <stdint.h> 18 #include <stdint.h>
12 #include <stdlib.h> 19 #include <stdlib.h>
84 } 91 }
85 if (bfi) 92 if (bfi)
86 gsmfr_preproc_bfi(pp_state, taf, frame); 93 gsmfr_preproc_bfi(pp_state, taf, frame);
87 else 94 else
88 gsmfr_preproc_good_frame(pp_state, frame); 95 gsmfr_preproc_good_frame(pp_state, frame);
96 fputs("Xform:", stdout);
97 gsm_explode(dec_state, frame, fr_params);
98 n = 0;
99 for (i = 0; i < 8; i++)
100 printf(" %u", fr_params[n++]);
101 putchar('\n');
102 for (i = 0; i < 4; i++) {
103 putchar(' ');
104 for (j = 0; j < 17; j++)
105 printf(" %u", fr_params[n++]);
106 putchar('\n');
107 }
89 gsm_decode(dec_state, frame, pcm); 108 gsm_decode(dec_state, frame, pcm);
90 samp_max = 0; 109 samp_max = 0;
91 for (i = 0; i < 160; i++) { 110 for (i = 0; i < 160; i++) {
92 if (pcm[i] >= 0) 111 if (pcm[i] >= 0)
93 samp_abs = pcm[i]; 112 samp_abs = pcm[i];