changeset 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 d21c68b8f16c
files frtest/max-out.c
diffstat 1 files changed, 25 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/frtest/max-out.c	Sun Nov 20 23:04:27 2022 +0000
+++ b/frtest/max-out.c	Mon Nov 21 01:02:07 2022 +0000
@@ -1,10 +1,17 @@
 /*
- * This program reads an extended-libgsm binary file, dumps every frame in
- * human-readable form just like gsmrec-dump, but then also passes it through
- * our GSM FR decoder (libgsmfrp+libgsm) and looks for the highest-magnitude
- * PCM sample in the decoder output.  This maximum output sample magnitude is
- * reported after the dump of each input frame.  This program is intended to
- * serve as a debug aid, for troubleshooting of our libgsmfrp+libgsm stack.
+ * This program reads an extended-libgsm binary file (which must be in FR
+ * codec format, not EFR) and performs the following processing, in this
+ * order:
+ *
+ * 1) dumps every frame in human-readable form just like gsmrec-dump;
+ * 2) passes the frame stream through our DTX Rx preprocessor;
+ * 3) dumps the output from the preprocessor;
+ * 4) feeds this output to the standard 06.10 decoder (libgsm);
+ * 5) finds the highest-magnitude PCM sample in the decoder output and
+ *    reports this maximum output magnitude.
+ *
+ * This program is intended to serve as a debug aid, for troubleshooting
+ * of our libgsmfrp+libgsm stack.
  */
 
 #include <stdio.h>
@@ -86,6 +93,18 @@
 			gsmfr_preproc_bfi(pp_state, taf, frame);
 		else
 			gsmfr_preproc_good_frame(pp_state, frame);
+		fputs("Xform:", stdout);
+		gsm_explode(dec_state, frame, fr_params);
+		n = 0;
+		for (i = 0; i < 8; i++)
+			printf(" %u", fr_params[n++]);
+		putchar('\n');
+		for (i = 0; i < 4; i++) {
+			putchar(' ');
+			for (j = 0; j < 17; j++)
+				printf(" %u", fr_params[n++]);
+			putchar('\n');
+		}
 		gsm_decode(dec_state, frame, pcm);
 		samp_max = 0;
 		for (i = 0; i < 160; i++) {