diff amrtest/mode_kw.c @ 422:1ceda5586d01

implement twamr-tseq-enc test program
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 07 May 2024 06:27:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/amrtest/mode_kw.c	Tue May 07 06:27:20 2024 +0000
@@ -0,0 +1,34 @@
+/*
+ * The function in this module groks user-input mode strings like "MR122"
+ * and returns the mode number.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include "../libtwamr/tw_amr.h"
+
+grok_mode_name(mode_str, mode_out)
+	char *mode_str;
+	enum Mode *mode_out;
+{
+	if (!strcmp(mode_str, "MR475"))
+		*mode_out = MR475;
+	else if (!strcmp(mode_str, "MR515"))
+		*mode_out = MR515;
+	else if (!strcmp(mode_str, "MR59"))
+		*mode_out = MR59;
+	else if (!strcmp(mode_str, "MR67"))
+		*mode_out = MR67;
+	else if (!strcmp(mode_str, "MR74"))
+		*mode_out = MR74;
+	else if (!strcmp(mode_str, "MR795"))
+		*mode_out = MR795;
+	else if (!strcmp(mode_str, "MR102"))
+		*mode_out = MR102;
+	else if (!strcmp(mode_str, "MR122"))
+		*mode_out = MR122;
+	else
+		return -1;
+	return 0;
+}