diff pcmu2efr/gen-amrefr.c @ 22:f4420403219a

pcmu2efr: change linear input gen to support 2nd frame
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 12 May 2024 03:40:27 +0000
parents 2bdcd2ed9a1c
children
line wrap: on
line diff
--- a/pcmu2efr/gen-amrefr.c	Sun May 12 03:15:23 2024 +0000
+++ b/pcmu2efr/gen-amrefr.c	Sun May 12 03:40:27 2024 +0000
@@ -1,5 +1,5 @@
 /*
- * The code in this module takes linear_inputs[][] from gen160.c
+ * The code in this module takes linear_input_array[] from gen160.c
  * and generates EFR-format frames by way of libtwamr encoder.
  */
 
@@ -9,7 +9,7 @@
 #include <gsm_efr.h>
 #include <tw_amr.h>
 
-extern uint16_t linear_inputs[160][160];
+extern uint16_t linear_input_array[480];
 
 uint8_t amr_efr[160][31];
 
@@ -27,7 +27,8 @@
 	}
 	for (m = 0; m < 160; m++) {
 		amr_encoder_reset(st, 0, 0);
-		amr_encode_frame(st, MR122, (const int16_t *) linear_inputs[m],
+		amr_encode_frame(st, MR122,
+				 (const int16_t *) linear_input_array + 160 - m,
 				 &amr_frame);
 		EFR_params2frame(amr_frame.param, amr_efr[m]);
 	}